How to use Python to interface with Web pages?

P

Peter

Any help would be appreciated :)

I want to write an auction sniping tool in Python. I know Python, but
I know absolutely nothing about web pages, javascript etc i.e. I want
the program to automatically log me into my eBay account, access the
appropriate item, locate how many mins/seconds until the bid time ends
and then automatically place a bid at the last possible moment.

I can see the web-page source - it looks to be javascript (to my
untutored eye :)).

But how do I enter data and "simulated" mouse presses on a web-page
that I have accessed via a Python program?

So where can I start to learn how to do this? Any books available? web
resources that show examples or offer tutorials?

I have (in the past) written some python to scoop data off web-sites
but I have never written anything that interactively interacts with
the web-page contents and don't know where to even start on this one.

Thanks for any help/pointers

Peter
 
R

Ralf Schoenian

Peter said:
Any help would be appreciated :)

I want to write an auction sniping tool in Python. I know Python, but
I know absolutely nothing about web pages, javascript etc i.e. I want
the program to automatically log me into my eBay account, access the
appropriate item, locate how many mins/seconds until the bid time ends
and then automatically place a bid at the last possible moment.

I can see the web-page source - it looks to be javascript (to my
untutored eye :)).

But how do I enter data and "simulated" mouse presses on a web-page
that I have accessed via a Python program?

So where can I start to learn how to do this? Any books available? web
resources that show examples or offer tutorials?

I have (in the past) written some python to scoop data off web-sites
but I have never written anything that interactively interacts with
the web-page contents and don't know where to even start on this one.

Thanks for any help/pointers

Peter

Hi,

a good starting point possibly is
http://wwwsearch.sourceforge.net/mechanize/

Regards,
Ralf
 
A

alex23

I can see the web-page source - it looks to be javascript (to my
untutored eye :)).

But how do I enter data and "simulated" mouse presses on a web-page
that I have accessed via a Python program?
[...]
I have (in the past) written some python to scoop data off web-sites
but I have never written anything that interactively interacts with
the web-page contents and don't know where to even start on this one.

I don't have much experience with it, but for interacting with
javascript-heavy pages you might want to take a look at Selenium:

http://seleniumhq.org/
http://pypi.python.org/pypi/selenium
http://jimmyg.org/blog/2009/getting-started-with-selenium-and-python.html
http://joker.linuxstuff.pl/documentation/make_selenium

It's primarily aimed at testing web app UIs, but if it allows for
values to be passed into tests then 'test' == 'action' in terms of
your requirements.

Hope this helps.

- alex23
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top