A message on the login page with a beautiful soup

I am using python and beautifulsoup (new to both!) And I want to log into the suppliers website.

Thus, their form looks (simplified):

<form name=loginform action=/index.html method="post"> <input name=user> <input name=pass"> </form> 

Is there a way to track cookies?

+6
python beautifulsoup
source share
2 answers

Do some more reading.

Read about urllib2 This is what you use to send POST to login. If you know the names <input> , you do not need a beautiful soup. http://docs.python.org/library/urllib2.html

Beautiful Soup is what you use to analyze the results page. After logging in. After you post a real request.

+8
source share

Use mechanize - this is the best (third-party) Python library for interacting with web forms, tracking cookies and with.

+8
source share

All Articles