urllib and parsing

luca72 lucaberto at libero.it
Tue Oct 4 03:00:45 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, please note i don't have to parse this
file, but i have to parse the site where he point.



More information about the Python-list mailing list