I have this link:
I want to download the embedded PDF.
I have tried the normal methods of urllib and request but they're not working.
import urllib2
url = "http://www.equibase.com/premium/chartEmb.cfm?track=ALB&raceDate=06/17/2002&cy=USA&rn=1"
response = urllib2.urlopen(url)
file = open("document.pdf", 'wb')
file.write(response.read())
file.close()
Moreover, I have also tried to find the original link of the pdf but it also did not work.
Internal link:
解决方案
Using Selenium with a specific ChromeProfile you can download embedded pdfs using the following code:
Code:
def download_pdf(lnk):
from selenium import webdriver
from time import sleep
options = webdriver.Chrom