Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can web automation be done in Python? [closed]

I am a newborn programmer still programming from the book on my Alt+Tab. One of the first programs I want to create is to help my mom in her work. I need to know if I can use Python to create it.

It needs to:

  1. Go on-line and log-in with account / pass.

  2. Do a search with specific criteria (use the site's search engine)

  3. View all the results and pick only the newest ones.

  4. Sort them out.

  5. Notify me so that the newest adds are noticed the moment they are posted on the website.

From what I see the site says : .cgi in the end.

I know python can connect, download the text from a page and sort the wanted info, but can it log in, use the search engine and pick the options I need?

I don't want to skip my learning process, but I am so serious about this project I am ready to put Python on hold and start learning some language that can do it!

I will very much appreciate your guidance! Thank you for your time!

AJ

like image 530
troty_master Avatar asked Dec 09 '22 01:12

troty_master


1 Answers

I think you should take a look at the Mechanize project. It is a stateful browser in Python, so that you can easily submit forms and things of that nature and maintain a session. You'll want to then use lxml.html or BeautifulSoup to inspect the document (although Mechanize itself contains some tools for inspecting documents).

like image 61
Thomas Allen Avatar answered Dec 26 '22 07:12

Thomas Allen