Skip to content
Advertisement

unable to scrape website pages with unchanged url – python

im trying to get the names of all games within this website “https://slotcatalog.com/en/The-Best-Slots#anchorFltrList”.To do so im using the following code:

JavaScript

and i get what i want. I would like to replicate the same across all pages available on the website, but given that the url is not changing, I looked at the network (XMR) events on the page happening when clicking on a different page and I tried to send a request using the following code:

JavaScript

result : (“KeyError: ‘title'”) – meaning that its not finding the class “providerCard”. Has the request to the website been done in the wrong way? If so, where should i change the code? thanks in advance

Advertisement

Answer

Alright, so, you had a typo. XD It was this "lang":"end" from the payload but it should have been "lang": "en", among other things.

Anyhow, I’ve cleaned your code up a bit and it works as expected. You can keep looping for all the games, if you want.

JavaScript

Output (for page 1 only):

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement