Alanic
New member
I am trying to scrape a webpage with a pdf.
With request, I used the following code to get the bytes and save it with open()
And it works just fine,
However on the below webpage I am using selenium but could not get the bytes from response object to use in the above code,
link to pdf (this has captcha that I solve with 2captcha)
Current response that I recieve
With request, I used the following code to get the bytes and save it with open()
Code:
pdf_response = requests.get(pdf_url)
with open("sample.pdf", 'wb') as f:
f.write(pdf_response.content)
f.close
And it works just fine,
However on the below webpage I am using selenium but could not get the bytes from response object to use in the above code,
Code:
#This does not return a byte object as requests
driver = webdriver.Chrome()
driver.get(base)
content = driver.page_source.encode('utf-8').strip()
link to pdf (this has captcha that I solve with 2captcha)
Current response that I recieve