Mar-23-2024, 02:12 AM
I did login to server to do a quick test.
The problem i get when try to download .xml with Request,
is that when Selenium has a session cookies that do not automatically goes over to Requests if try to download.
Then can do like this to transfer session cookie over to Requests.
The problem i get when try to download .xml with Request,
is that when Selenium has a session cookies that do not automatically goes over to Requests if try to download.
Then can do like this to transfer session cookie over to Requests.
session = requests.Session() selenium_cookies = driver.get_cookies() # Add each Selenium cookie to the Requests Session for cookie in selenium_cookies: session.cookies.set(cookie['name'], cookie['value']) print(driver.current_url) # This most be a url with .xml ending response = session.get(driver.current_url) with open('test1.xml', 'wb') as file: file.write(response.content)