-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrapy-selenium is yielding normal scrapy.Request instead of SeleniumRequest #78
Comments
I plus-oned this and then solved it for myself a little later. For me this is not in the context of testing, so I have no need for contracts (at least as far as understand it). My solve was the following:
Once I did this it started working. My solution snippet:
|
Hey @undernewmanagement I tried your snippet but the links in LinkExtractor are not processed correctly (response body is not text). rules = ( Rule(LinkExtractor(restrict_xpaths=(['//*[@id="breadcrumbs"]'])), follow=True),)
def start_requests(self):
for url in self.start_urls:
yield SeleniumRequest(url=url, dont_filter=True,)
def parse_start_url(self, response):
return self.parse_result(response)
def parse(self, response):
le = LinkExtractor()
for link in le.extract_links(response):
yield SeleniumRequest(url=link.url, callback=self.parse_result,)
def parse_result(self, response):
page = PageItem()
page['url'] = response.url
yield page I had to use parse_start_url to assign the parse_result callback to start urls. Do you know what the problem could be? I'm new in Scrapy and Python. Thanks! |
Hey @educatron thanks for the question - let's not hijack the thread here. I think you should take that question directly to the scrapy community. https://scrapy.org/community/ |
Ok. Thanks! |
@clemfromspace I just decided to use your package in my Scrapy project but it is just yielding normal scrapy.Requuest instead of SeleniumRequest
I have seen this issue but this is not helpful at all
The text was updated successfully, but these errors were encountered: