473,408 Members | 1,858 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,408 software developers and data experts.

fetching a POST webpage...

hi...

i have the basic code to fetcha url/web page. however, i'm trying to fetch a
page that uses a FORM/POST. has anyone done this, i've tried a few times
without success.

i've analyzed the data stream using Firefox/Livehttpheaders to get the HTTP
stream.. but i'm doing something wrong, and can't quite see what the
err/issue is...

if you've done this kind of thing, and you have some thoughts, let me know.
i can send you the output of the livehttpheaders app, and the test code that
i have...

thanks..

-bruce
Jul 7 '06 #1
1 1291

bruce wrote:
hi...

i have the basic code to fetcha url/web page. however, i'm trying to fetch a
page that uses a FORM/POST. has anyone done this, i've tried a few times
without success.

i've analyzed the data stream using Firefox/Livehttpheaders to get the HTTP
stream.. but i'm doing something wrong, and can't quite see what the
err/issue is...

if you've done this kind of thing, and you have some thoughts, let me know.
i can send you the output of the livehttpheaders app, and the test code that
i have...

thanks..

-bruce
If you read the page and parse the form or already know the values you
need to POST this may help.
>From http://www.python.org/doc/current/li...-examples.html
Here is an example session that shows how to "POST" requests:
>>import httplib, urllib
params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
headers = {"Content-type": "application/x-www-form-urlencoded",
.... "Accept": "text/plain"}
>>conn = httplib.HTTPConnection("musi-cal.mojam.com:80")
conn.request("POST", "/cgi-bin/query", params, headers)
response = conn.getresponse()
print response.status, response.reason
200 OK
>>data = response.read()
conn.close()
Jul 7 '06 #2

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

Similar topics

0
by: C3 | last post by:
Hi everone. I'm trying to write a shell script that fetches a number of images from a map website (www.whereis.com.au). Basically, the page asks you for a street address and then queries the...
2
by: Ben | last post by:
Hi I have the two funcions below, login_web that posts data to a webpage and fcn_parseviewstate that parses the viewstate data for the post. I have a problem with the strPostData, I have been...
22
by: Sandman | last post by:
So, I have this content management system I've developed myself. The system has a solid community part where members can register and then participate in forums, write weblogs and a ton of other...
0
by: barrybevel | last post by:
Hi, I'm trying to login to the www.vodafone.ie website using HttpWebRequest. It works fine with IE/Firefox and the .NET Web Control too, just not with my code. I think it's a redirect 302...
8
by: nazeers | last post by:
Hi All, I am new to XML and I need some help from you all. we have a requirement like... we want to fetch the base URL that is present in the XML file , and getting it displayed in the...
3
by: beautifulcarcass | last post by:
Hi, in this school project im making, im having a problem if i could display the column names from a table on a MYSQL database to a webpage through PHP with a loop is there a function to display...
1
by: itChirag | last post by:
Hi I want to know how data is fetched from web page & stored in sql data base. I have the design of webpage but cannot save data in sql table. please help!
7
by: FeelLikeANut | last post by:
I'm using the example on the following page for selecting and fetching a large data object. <http://publib.boulder.ibm.com/infocenter/db2luw/...
4
by: tokcy | last post by:
HI every one, i am using tooltip on click of link and i want like when that tooltip open then background window would be blure(). can anyone help me...
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: 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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.