【发布时间】:2020-05-27 16:06:36
【问题描述】:
以下是我尝试过的:
import scrapy
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from scrapy_selenium import SeleniumRequest
class PdfxSpider(scrapy.Spider):
name = 'pdf'
urls = 'https://www.pdfdrive.com/living-in-the-light-a-guide-to-personal-transformation-d10172273.html'
def start_requests(self):
yield SeleniumRequest(
url=self.urls,
callback=self.parse,
#wait_time=1000,
wait_until=EC.element_to_be_clickable((By.ID, 'alternatives'))
)
def parse(self, response):
print(response.css('a.btn-success').xpath('@href').get())
【问题讨论】:
-
有什么问题?
标签: python selenium web dynamic scrapy