'HTTP POST request - different requests return same response
I'm trying to retrieve data from a site by sending a POST request which appears to work, however, it returns the same result despite the request changing.
For example, if I change the dates, it will still return the same result and if I check this via the website manually, it should be different.
Any help would be greatly appreciated! I'm stuck with this.
Bdate = 20210220
Adate = 20220220
#Prepare the column headers
BdateVal = str(Bdate) + " Est. value ($m)"
AdateVal = str(Adate) + " Est. value ($m)"
#retrive payload and enter index + dates
d = {"__EVENTTARGET":"m$m$p1$p1$ITrakResults$DownloadButtoniTrak",
"__EVENTARGUMENT":"",
"__LASTFOCUS":"",
"__VIEWSTATE":VS,
"__VIEWSTATEGENERATOR":VSG ,
"__SCROLLPOSITIONX":0,
"__SCROLLPOSITIONY":0,
"m$m$p1$p1$ITrakFilter$ddlInvestmentIn":352,
"m$m$p1$p1$ITrakFilter$ddlComparisonPeriod":Bdate,
"m$m$p1$p1$ITrakFilter$HiddenFieldLatterDate":Adate,
"m$m$p1$p1$ITrakFilter$txtInvestorName":"",
"m$m$p1$p1$ITrakFilter$ddlInvestmentStyle":"",
"m$m$p1$p1$ITrakFilter$ddlInvestorList":"All Company Lists",
"m$m$p1$p1$ITrakFilter$ddlInvestmentTrends":0,
"m$m$p1$p1$ITrakFilter$slider_min":0,
"m$m$p1$p1$ITrakFilter$slider_max":71000,
"m$m$p1$p1$ITrakFilter$txtSliderLeftValue":0,
"m$m$p1$p1$ITrakFilter$txtSliderRightValue":71000,
"m$m$p1$p1$ITrakFilter$ucLocation$Location":"RadioButtonLocationIgnore",
"m$m$p1$p1$ITrakFilter$ucLocation$DropDownRegions":0,
"m$m$p1$p1$ITrakFilter$ucLocation$DropDownCountries":0}
params = {"InvIn":352,
"FormerDateID":Bdate,
"Holders":0,
"ShowDetail":"True",
"InvName":"",
"sort":"LatterEstMarketSegmentValue",
"sortAsc":"False"}
#Post request
GetCSV = s.post("https://secure.somewebsite.com/iTrak/Default.aspx?",params=params, headers=DownloadHeaders, data=d)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

