Я пытаюсь очистить этот URL:
"https://www.bloomberg.com/news/articles/2019-05-30/tesla-dealt-another-blow-as-barclays-sees-it-as-niche-carmaker"
Я хотел получить только название и дату публикации,
любой пример кода, который вы можете дать мне, даже всплеск и т. д.
пока что я попробовал это
def parse(self, response):
yield scrapy.Request('https://www.bloomberg.com/news/articles/2019-05-30/tesla-dealt-another-blow-as-barclays-sees-it-as-niche-carmaker -H x-crawlera-use-https:1',
headers={'X-Crawlera-Session': create,
'X-Crawlera-Timeout': 40000,
'X-Crawlera-Max-Retries': 5,
'X-Crawlera-Cookies': disable,
'X-Crawlera-Session': self.session_id
},
callback=self.parse_sub,
)
def parse_sub(self, response):
response.xpath("//h1[@class = 'lede-text-v2__hed']").extract_first()
response.xpath("//meta[@property = 'og:title']/@content").extract_first()
response.xpath("//time[@class = 'article-timestamp']/@datetime").extract_first()
print(response.text)
Я также использую crawlera, но он продолжает обнаруживать меня как робота