Please I need some corrections with this code. I need the code to post some data in ascending order on a website. But it posting same data not in ascending order. On Vs code terminal it showing Slot 1, Slot 2, Slot 3….DONE!! However this is the output am getting on site: slot 1, slot 1, slot 1……I want it to give Slot 1, slot 2, slot 3. Please help by giving detailed explanation and corrected code.Please I need some corrections with this code. I need the code to post some data in ascending order on a website. But it posting same data not import json import requests from urllib.parse import parse_qs url = 'https://xxx/xx_?svr=20&lang=en_us&r=66.6807158491761' cookies = { 'test_cookie': '1', 'liveagent_sid': 'dd599e6f-8b87-4JUdGzvrMFDWrUUwY3toJATSeNwjn54LkCnKBPRzDuhzi5vSepHxxJNxRL2gjkNrSqtCoRUrEDAgRwsQvVCjZbRyFTLRNyDmT1a1boZVen_us&r=9.20753521038158', 'xx_region_selection': 'dismissed', 'liveagent_vc': '1', 'lang': '', 'OptanonConsent': 'geolocation=US%3BGA&datestamp=Mon+Jun+05+2023+12%3A35%3A40+GMT-0700+(Pacific+Daylight+Time)&version=6.24.0&isIABGlobal=false&hosts=&landingPath=NotLandingPage&groups=C0001%3A1%2CC0003%3A1%2CC0002%3A1%2CC0004%3A1%2CBG42%3A1&AwaitingReconsent=false', 'session-id': '2eb2b6546708416e900918ae63761a8a', 'legacy-session-id': '2eb2b6546708416e900918ae63761a8a', 't': '2eb2b6546708416e900918ae63761a8a', } headers = { 'authority': 'xx.com', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8', 'accept-language': 'en-US,en;q=0.5', 'cache-control': 'max-age=0', 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryJxuAHmUB9xZ0Yg7u', # 'cookie': 'test_cookie=1; liveagent_sid=dd599e6f-8b87-4JUdGzvrMFDWrUUwY3toJATSeNwjn54LkCnKBPRzDuhzi5vSepHxxJNxRL2gjkNrSqtCoRUrEDAgRwsQvVCjZbRyFTLRNyDmT1a1boZVen_us&r=9.20753521038158; xx_region_selection=dismissed; liveagent_vc=1; lang=; OptanonConsent=geolocation=US%3BGA&datestamp=Mon+Jun+05+2023+12%3A35%3A40+GMT-0700+(Pacific+Daylight+Time)&version=6.24.0&isIABGlobal=false&hosts=&landingPath=NotLandingPage&groups=C0001%3A1%2CC0003%3A1%2CC0002%3A1%2CC0004%3A1%2CBG42%3A1&AwaitingReconsent=false; session-id=2eb2b6546708416e900918ae63761a8a; legacy-session-id=2eb2b6546708416e900918ae63761a8a; t=2eb2b6546708416e900918ae63761a8a', 'origin': 'https://xx.com', 'referer': 'https://xx.com/t_modify_assignment.asp?at=1&svr=40&lang=en_us&r=91.4189872857957', 'sec-ch-ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Brave";v="114"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"Windows"', 'sec-fetch-dest': 'document', 'sec-fetch-mode': 'navigate', 'sec-fetch-site': 'same-origin', 'sec-fetch-user': '?1', 'sec-gpc': '1', 'upgrade-insecure-requests': '1', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36', } params = { 'at': '1', 'svr': '40', 'lang': 'en_us', 'r': '91.4189872857957', } for i in range(1,203): file_name = f"Slot{i}" data = f'------WebKitFormBoundaryJxuAHmUB9xZ0Yg7u\r\nContent-Disposition: form-data; name="referred_from_inbox"\r\n\r\n0\r\n------ response = requests.post ( 'https://www.xxxx.com/t_xx.asp', params=params, cookies=cookies, headers=headers, data=data, ) print(f"{file_name} DONE") Please I need some corrections with this code. I need the code to post some data in ascending order on a website. But it posting same data not in ascending order. On Vs code terminal it showing Slot 1, Slot 2, Slot 3….DONE!! However this is the output am getting on site: slot 1, slot 1, slot 1……I want it to give Slot 1, slot 2, slot 3. Please help by giving detailed explanation and corrected code.
Please I need some corrections with this code. I need the code to post some data in ascending order on a website. But it posting same data not in ascending order. On Vs code terminal it showing Slot 1, Slot 2, Slot 3….DONE!! However this is the output am getting on site: slot 1, slot 1, slot 1……I want it to give Slot 1, slot 2, slot 3. Please help by giving detailed explanation and corrected code.Please I need some corrections with this code. I need the code to post some data in ascending order on a website. But it posting same data not
import json
import requests
from urllib.parse import parse_qs
url = 'https://xxx/xx_?svr=20&lang=en_us&r=66.6807158491761'
cookies = {
'test_cookie': '1',
'liveagent_sid': 'dd599e6f-8b87-4JUdGzvrMFDWrUUwY3toJATSeNwjn54LkCnKBPRzDuhzi5vSepHxxJNxRL2gjkNrSqtCoRUrEDAgRwsQvVCjZbRyFTLRNyDmT1a1boZVen_us&r=9.20753521038158',
'xx_region_selection': 'dismissed',
'liveagent_vc': '1',
'lang': '',
'OptanonConsent': 'geolocation=US%3BGA&datestamp=Mon+Jun+05+2023+12%3A35%3A40+GMT-0700+(Pacific+Daylight+Time)&version=6.24.0&isIABGlobal=false&hosts=&landingPath=NotLandingPage&groups=C0001%3A1%2CC0003%3A1%2CC0002%3A1%2CC0004%3A1%2CBG42%3A1&AwaitingReconsent=false',
'session-id': '2eb2b6546708416e900918ae63761a8a',
'legacy-session-id': '2eb2b6546708416e900918ae63761a8a',
't': '2eb2b6546708416e900918ae63761a8a',
}
headers = {
'authority': 'xx.com',
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
'accept-language': 'en-US,en;q=0.5',
'cache-control': 'max-age=0',
'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryJxuAHmUB9xZ0Yg7u',
# 'cookie': 'test_cookie=1; liveagent_sid=dd599e6f-8b87-4JUdGzvrMFDWrUUwY3toJATSeNwjn54LkCnKBPRzDuhzi5vSepHxxJNxRL2gjkNrSqtCoRUrEDAgRwsQvVCjZbRyFTLRNyDmT1a1boZVen_us&r=9.20753521038158; xx_region_selection=dismissed; liveagent_vc=1; lang=; OptanonConsent=geolocation=US%3BGA&datestamp=Mon+Jun+05+2023+12%3A35%3A40+GMT-0700+(Pacific+Daylight+Time)&version=6.24.0&isIABGlobal=false&hosts=&landingPath=NotLandingPage&groups=C0001%3A1%2CC0003%3A1%2CC0002%3A1%2CC0004%3A1%2CBG42%3A1&AwaitingReconsent=false; session-id=2eb2b6546708416e900918ae63761a8a; legacy-session-id=2eb2b6546708416e900918ae63761a8a; t=2eb2b6546708416e900918ae63761a8a',
'origin': 'https://xx.com',
'referer': 'https://xx.com/t_modify_assignment.asp?at=1&svr=40&lang=en_us&r=91.4189872857957',
'sec-ch-ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Brave";v="114"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-site': 'same-origin',
'sec-fetch-user': '?1',
'sec-gpc': '1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
}
params = {
'at': '1',
'svr': '40',
'lang': 'en_us',
'r': '91.4189872857957',
}
for i in range(1,203):
file_name = f"Slot{i}"
data = f'------WebKitFormBoundaryJxuAHmUB9xZ0Yg7u\r\nContent-Disposition: form-data; name="referred_from_inbox"\r\n\r\n0\r\n------
response = requests.post (
'https://www.xxxx.com/t_xx.asp',
params=params,
cookies=cookies,
headers=headers,
data=data,
)
print(f"{file_name} DONE")
Please I need some corrections with this code. I need the code to post some data in ascending order on a website. But it posting same data not in ascending order. On Vs code terminal it showing Slot 1, Slot 2, Slot 3….DONE!! However this is the output am getting on site: slot 1, slot 1, slot 1……I want it to give Slot 1, slot 2, slot 3. Please help by giving detailed explanation and corrected code.
Step by step
Solved in 4 steps