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

Submit a post request to an asp.net form

Using requests & beautiful soup to make a post request to an asp.net form However I've no luck in actually posting the website keeps redirecting to the login screen


this is how I build the form data
Expand|Select|Wrap|Line Numbers
  1.     soup = BeautifulSoup(page.content,features="lxml")
  2.     viewstate = soup.select_one("#__VIEWSTATE")["value"]
  3.     viewstategenerator = soup.select_one("#__VIEWSTATEGENERATOR")["value"]
  4.     lastfocus = soup.select_one("#__LASTFOCUS")["value"]
  5.     eventtarget = soup.select_one("#__EVENTTARGET")["value"]
  6.     eventargument = soup.select_one("#__EVENTARGUMENT")["value"]
  7.     data = {
  8.             r'ScriptManager1': r'UpdatePanel1|btnLogin',
  9.             r'__ASYNCPOST': r'true',
  10.             r'___VIEWSTATE': viewstate,
  11.             r'__VIEWSTATEGENERATOR': viewstategenerator,
  12.             r'__EVENTTARGET': eventtarget,
  13.             r'__EVENTARGUMENT': eventargument,
  14.             r'__LASTFOCUS': lastfocus,
  15.             r'ddlAuthentication': r'HRView Authentication',
  16.             r'tbUsername': r'odoo',
  17.             r'tbPassword': r'odoo', 
  18.             r'ddlCompany': r'1',
  19.             r'hfForceReset': r'False,False',
  20.             r'btnLogin': r'Login',
  21.  
  22.         }
  23.  
these are the only form data needed to make the post request & I've verified that from chrome developer tools

Attached Images
File Type: jpg Capture.jpg (105.6 KB, 554 views)
Jan 29 '19 #1
1 1524
It doesn't seem that this parser is supported in bs4

https://www.crummy.com/software/Beau...lling-a-parser
Jan 31 '19 #2

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

Similar topics

1
by: Chris Nelder | last post by:
I think I must be losing my mind here. I've got the same page running on two different machines. I do the same form post on both, and on one machine I get Request.Form.Count=21 and on the other...
5
by: Wayne Wengert | last post by:
I am trying to use Request.Form to differentiate between when a page containing a form is first loaded and when it is reloaded as a result of the user clicking on the Submit button. Things are not...
5
by: momo | last post by:
Hello Newsgroup, I want to pass a Request.Form variable to an ASP form, through the url for example lets say i have a form with a textfiled called "txtName" if i click the submit button for...
5
by: Paxton | last post by:
I created an html email containing a form whose method is POST. The form is posted to an asp page for processing, but no values are retrieved. So I response.write all the Request.Form fields, and...
2
by: Laurent Bertin | last post by:
Hi i got a strange problem but it's true i don't make thing like anyone... First Config: + IIS5.0 SP2 (yes i know...) WebSite Security Root : Digest Authentication, NT Authenticated SubFolders...
8
by: abcd | last post by:
I can get the value on the form at the server side by using Request.form("max") when max field is disabled I dont get value. For GUI and business logic purpose I have disabled some fields with...
4
by: whyyyy | last post by:
USING IIS 5.1, and Windows XP pro, the following form works on my system, and I can use as many form elements as I wish, as long as all form elements have the same name: "words", in this example....
10
by: Steve Last | last post by:
Hi all, I’m using IIS6 for our college Intranet and I’m having trouble using Request.Form. Here is my code: <% If Request.QueryString("action") = "show" Then Response.Write "title: " &...
2
by: MDANH2002 | last post by:
Hi From VB.NET I want to simulate the POST request of the following HTML form <html> <title>HTTP Post Testing</title> <body> <form action=http://www.example.com/postdata ...
3
by: Jag | last post by:
Hi I am facing a strange issue. I have 3 ASP pages in the default website 1. auth.aspx <html> <body>
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...

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.