Can I use Grab (python) to open link in "new window" and get the html?

You have a page with a link. Need html can only be obtained when switching from this page to another page (in a new tab). Whether it is possible to implement this logic using Grab?
July 8th 19 at 15:39
2 answers
July 8th 19 at 15:41
Solution
Grab made based on lxml, and lxml is no logic work with Windows and JavaScript. So the answer is no, you cannot.
As page understands what I went to the page? Ka catch is a script? Looking through Chrome, there onclick: null - Otha_Beahan commented on July 8th 19 at 15:44
http://ru.stackoverflow.com/questions/375573/Парси... - Otha_Beahan commented on July 8th 19 at 15:47
: I think it's the pages themselves and in the transmitted data. Maybe in the session something is written, it is necessary to look specifically on the website. A separate page could do for convenience. - Titus_Kuhlman76 commented on July 8th 19 at 15:50
: t e is difficult to catch? - Otha_Beahan commented on July 8th 19 at 15:53
Ctrl+Shift+i in the browser, the Network tab. And there already see where what goes where. - Titus_Kuhlman76 commented on July 8th 19 at 15:56
July 8th 19 at 15:43
No new window opening is not necessary, just your tag a is the attribute target="_blank". So your browser when clicking on a link opens a new window. The spider will be a link from the attribute href.

I think the logic of action your spider should be like this:

Get the page source -> Find a tag a -> extract the link from the href attribute -> Get the page for the download link


And then can disassemble the landing page.

Find more questions by tags PythonParsing