Answer the question
In order to leave comments, you need to log in
Is it possible with Grab (python) to open a link in a "new window" and pull out the html?
There is a page with a link. The required html can only be obtained when moving from this page to another (in a new tab). Is it possible to somehow implement this logic through Grab?
Answer the question
In order to leave comments, you need to log in
Grab is based on lxml, and in lxml there is no logic for working with windows and javascript at all. So the answer is no, you can't.
No new window needs to be opened, just your a tag has the target="_blank" attribute . Therefore, your browser opens a new window when you click on the link. The spider will only need a link from the href attribute .
I think the logic of your spider should be something like this:
And then you can already parse the landing page.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question