-2

I want to create a python scraper.

The thing is, I have a main page and then I need to 'open' a new tab, scrap it and come back to the main page to open the next one.

I mean:

MAIN PAGE --> first tab(scraping it) --> MAIN PAGE --> second tab(scraping it) --> MAIN PAGE --> third tab(scraping it) and so on.

every tab's url has the same construction, but random numbers: www.something.com/321312312 and the next one has www.something.com/14421 , so I can do it via regex, but cannot do it as go to the next page.

What should I do? Webdriver from Selenium?

Thanks!

Gignac
  • 191
  • 1
  • 15

1 Answers1

2

Considering all the tabs are already opened, perhaps just use python to automate the key presses to move to the next tab (CMD + Option + left/right arrows). See here for how to do key presses in Python.

King
  • 827
  • 2
  • 10
  • 20