473,408 Members | 2,832 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.

on posting form data to a site, getting default response only

I want to get a response from a site by posting a form data programmatically using Python 3.4.2 (to avoid boring task of obtaining data (about 2400 times) through std.Browser. Following code works (?) but not for the posted data but a default response obtained.

Expand|Select|Wrap|Line Numbers
  1. # Python 3.4.2
  2. # Request for posting data is it OK ?
  3. # Response for only default data received
  4. import urllib.request
  5. import urllib.parse
  6. url = 'http://www.xxx.php?dd=14'    
  7. headers={}
  8. headers['User-Agent'] = "Mozilla/5.0 xxx'
  9. # header added to dupe server to indicate source 
  10. # of request as a Standard browser
  11. req = urllib.request.Request(url , headers = headers)
  12. #print(req)  
  13. respon = urllib.request.urlopen(req)
  14. # print(len(resp)) 
  15. print(respon.status)
  16. resp = respon.read()
  17.  
Can any body help me?
Apr 26 '16 #1
0 1108

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JMR | last post by:
How do I post to a server in the background and capture the html it spits back? This code re-driects to the server: function go() { document.cps.action = "http://remote_server_URL:PORT" ...
0
by: Ghafran Abbas | last post by:
To programmatically post form data to a web page and get the result in ..net, use the following code. ===========Begin Code================ Imports System.Net Public Sub PostDataToForm() ...
0
by: apinti | last post by:
Here is my code, and the problem: $st="...(string to post is formed from different variables read from file)..."; $lngth=strlen($st); $ch = curl_init(); curl_setopt($ch,...
5
by: apinti | last post by:
Here is my code, and the problem: $st="...(string to post is formed from different variables read from file)..."; $lngth=strlen($st); $ch = curl_init(); curl_setopt($ch,...
3
by: one.1more | last post by:
How do i post the form data to different php files at once. I tried the following code but it doesn't work. the data is sent only to the first php file. <form method="post" action="insert.php"...
2
by: Norman Peelman | last post by:
From: "Norman Peelman" <npeelman@cfl.rr.com> Subject: Re: posting form data to two php scripts at once Date: Sunday, December 17, 2006 12:06 AM <one.1more@gmail.comwrote in message...
2
by: Hamayun Khan | last post by:
Hi I have Two pages Default.aspx and Default2.aspx Default.aspx has the following code <%@ Page Language="VB" MasterPageFile="~/Main.master" AutoEventWireup="false"...
1
by: mandanarchi | last post by:
I'm using Access 2003 and I need to send an xml file via POST. I've got two others set up just the same, both work fine. The problem is, this one tells me I need to send it as form-data with a name...
2
by: gubbachchi | last post by:
Hi, I have a form whose elements are created dynamically on selection, i.e. the form has only text boxes and the number of text boxes depends on the users selection, if user selects 3 then 3...
2
by: Sridhar G | last post by:
I am new to VBA and have very minimum knowledge on it. I have a form with data (records) loaded and when you double click any record in the form, one edit form will be opened where you can edit the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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.