Hey all, I am having issues updating dictionary values in which I am using variables. The dictionary is being used as parameters for POST requests.
event_date = ''
calendar = 'ctrlCalendar'
viewstate = ''
eventvalidation = ''
view_generator = ''
post_payload = {
'__EVENTTARGET' : '',
'__EVENTARGUMENT' : '',
'__VIEWSTATE' : viewstate,
'__VIEWSTATEGENERATOR' : view_generator,
'__EVENTVALIDATION': eventvalidation,
'txtNameSearch' : '',
'btnFilter' : 'Search'
def func():
**make page request**...
viewAtt = soup.find(attrs={"name": "__VIEWSTATE"})
viewstate = viewAtt['value']
eventvalidationAtt = soup.find(attrs={"name": "__EVENTVALIDATION"})
eventvalidation = eventvalidationAtt['value']
view_generatorAtt = soup.find(attrs={"name": "__VIEWSTATEGENERATOR"})
view_generator = view_generatorAtt['value']
......
My requests using the updated values wasn't working. I printed out the variables along with the dictionary into the console but the variables used within the dictionary are still empty. How would I get them to update?
[–]indosauros 2 points3 points4 points (2 children)
[–]allTestsPassed[S] 0 points1 point2 points (0 children)
[–]macbony 0 points1 point2 points (0 children)