How can I enter data into a web page to clear the result using Python?

I am familiar with BeautifulSoup and urllib2 to clear data from a web page. However, what if the parameter needs to be entered into the page before the result I want to clear is returned?

I am trying to get the geographical distance between two addresses using this site: http://www.freemaptools.com/how-far-is-it-between.htm

I want you to be able to go to the page, enter two addresses, click "Show", and then extract the values ​​"Distance like raven flies" and "Distance by ground transport" and save them in the dictionary.

Is there a way to enter data into a webpage using Python?

+5
source share
5 answers

Yes! Try mechanize for this task of cleaning your web screen.

+1
source

, PySide/PyQt, ​​ qtwebkit, , , (, ...), . FMiner , -, PySide.

phantomjs, , javascript, python lanuage.

+1

. , ( "/-" ) . . http://www.freemaptools.com/ajax/getaandb.php?a=Florida_Usa&b=New%20York_Usa&c=6052 → , . , . IMHO, , ( ).

, , / (Mechanize, Splinter) (PhantomJS, ) , .

0
source

The request may be allowed.

For this purpose you can use Selenium WebDriver . Using a programming language, you can interact with a web page. All operations can be performed as if the user had access to a web page.

0
source

All Articles