open html page for parsing

luca72 lucaberto at libero.it
Tue Oct 4 02:58:15 EDT 2011


Hello i have a simple question:
up to now if i have to parse a page i do as follow:
import urllib
site = urllib.urlopen('http://www.blabla.ooo')
list_a = site.readline()
site.close()
__and then i make my work__

Now i have the site that is open by an html file like this:
		<table>
<b>insert the password</b>
<form name="form_a" method="POST" action="http://lalal.hhdik/
lolo.php">
				<input type="passwd" name="password" value="password"></input>;
				<input type="submit" name="Entra" value="entra"></input>;
			</form>
		</table>


</div>
<script type="text/javascript">
document.form_a.submit();
</script>

this is in a file called example.html

how can i open it with urllib



More information about the Python-list mailing list