Home > Back-end >  Python Selenium LinkedIn company webscraping
Python Selenium LinkedIn company webscraping

Time:11-05

I'm trying to use webscraping (via Python and Selenium) to create a worksheet with companies of interest to my boss. Most of it is working, I just can't seem to get hold of the "Next Page" button. Relative and absolute XPaths, CSS selectors, nothing seems to work, since every time you generate/switch pages they're diferent. (The relative XPath usually is '//*[@id="ember{SOME RANDOM NUMBER}"]') What could I do? There are other buttons with the same relative XPath structure in the page. Here's the damn button I'm trying to click.

CodePudding user response:

The Next page button has the same XPath for all the pages.
It is //button[@aria-label="Next"]
You should locate this element according to the aria-label attribute, not the id attribute value.

  • Related