M
M
Mark Adams2016-06-08 16:26:22
Python
Mark Adams, 2016-06-08 16:26:22

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

2 answer(s)
V
Vyacheslav, 2016-06-08
@ilyakmet

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.

A
Artyom Innokentiev, 2016-06-09
@artinnok

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 question

Ask a Question

731 491 924 answers to any question