473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Writing web bots in python

Hello,
I hav a question..How do I write a webbot that logs onto some website,
fills text into a textbox and submit that form, Sorry I am a novice in
python, apparently I have to use urllib, but I hav a few queries on
this, What happens when there are more input interfaces..does urllib
make somekind of a template when it does so..need more info on
this..links and tutorilas would be appreciated..thanx

Sudharshan S

Mar 18 '06 #1
4 3588

su******@gmail.com wrote:
Hello,
I hav a question..How do I write a webbot that logs onto some website,
fills text into a textbox and submit that form, Sorry I am a novice in
python, apparently I have to use urllib, but I hav a few queries on
this, What happens when there are more input interfaces..does urllib
make somekind of a template when it does so..need more info on
this..links and tutorilas would be appreciated..thanx

You should use urllib2 rather than urllib. You can see tutorials on
urllib2, and handling cookies if you need to at :

http://www.voidspace.org.uk/python/a.../urllib2.shtml
http://www.voidspace.org.uk/python/a...ookielib.shtml

*However*, this only handles fetching the web pages and posting data
back. You need something that will understand the web 'form' and fill
it in for you.

You probably want Mechanize *or* something like FormEncode. Google for
these.

All the best,

Fuzzyman

Sudharshan S


Mar 18 '06 #2
Thanx for the info..i'll let you know when it works

Mar 18 '06 #3
<su******@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Hello,
I hav a question..How do I write a webbot that logs onto some website,
fills text into a textbox and submit that form, Sorry I am a novice in
python, apparently I have to use urllib, but I hav a few queries on
this, What happens when there are more input interfaces..does urllib
make somekind of a template when it does so..need more info on
this..links and tutorilas would be appreciated..thanx

Sudharshan S


C.Titus Brown gave a quick but impressive demo of twill at the Pycon
lightning talks. I think this will do just what you need.
http://www.idyll.org/~t/www-tools/twill/

-- Paul
Mar 18 '06 #4
On 2006-03-18, su******@gmail.com <su******@gmail.com> wrote:
Hello,
I hav a question..How do I write a webbot that logs onto some website,
fills text into a textbox and submit that form, Sorry I am a novice in
python, apparently I have to use urllib, but I hav a few queries on
this, What happens when there are more input interfaces..does urllib
make somekind of a template when it does so..need more info on
this..links and tutorilas would be appreciated..thanx


Not strictly Python related, but if you use Firefox, get the "Tamper
Data" extension for it. This lets you see exactly what Firefox is
submitting in the formdata, and what the urls are of the cgi scripts
etc.

I usually invoke a program called curl from python with os.popen, but
this twill someone has suggested looks interesting.
Mar 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: charliewest | last post by:
I've seen on some websites that email address are "hidden" and protected from "spam bots". I've inquired how this is done in HTML and ASP newsgroups, but nobody seems to know... or answer. This is...
1
by: Brian W | last post by:
I was hoping someone here would know something about screen scrapers, spiders, bots. Perhaps it's a stupid question, but here it goes anyway... Is there any way to make data harder for a screen...
2
by: Amil | last post by:
I want to track page hits, but I won't want to record when a bot (e.g. google) visits my page. I currently have the META NOFOLLOW HTML on, but that doesn't force a bot to not visit embedded links....
3
by: Amit Khemka | last post by:
Hello, I am trying to write an IM Bot, which automatically replies to a message, in Python. I was wondering If there are python modules for connecting to Yahoo!, msn networks ... ideally I would...
2
by: SirDarckCat | last post by:
Hello I have made a PHP class for making bots and webmessengers with PHP. Its use is very simple for example: This function will simply login to the .NET Passport account.. and show the...
1
by: gyung | last post by:
Are spam bots able to send out date for the server to collect and give them a session? In Firefox, when I disable ALL cookies via web developer, I'm able to block off a certain page simply by...
3
by: randommale9999 | last post by:
I was wondering how people are able to create ajax applications like star ratings scripts without having bots hit the scripts. I have a star rating script on my site which was getting hit by bots....
3
by: koutoo | last post by:
I have a code that writes to 2 seperate files. I keep getting a "list index out of range" error. The strange part is that when checking the files that I'm writing too, the script has already...
28
by: William Gill | last post by:
I am getting a lot of phony form submissions. I assume they are not being done manually because of the volume, but by some sort of spam-bot. I thought of putting some code in the php processing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.