Using python to get content from website that requires javascript and that info is not part of source

Issue

I would like to extract the information from this website: https://poit.bolagsverket.se/poit-app/kungorelse/K397881-22

The part I am looking for is this:

enter image description here

But the problem is that this website requires javascript.

I am not sure how to go about extracting this information and it seems that this info is not part of the source code.

What I would like to do is to put the information into a list like this:

[{
orgnr:559387-6435,
företagsnamn:Aktiebolaget Grundstenen 300298,
säte:Stockholm,
etc.
}, {
orgnr:4389483439,
företagsnamn:Some other name,
säte:some city,
etc.
}]

I get this link and a several other links from a list I create in an earlier step

[link1:https….,link2:https…,link3:https…]

I have tried to use selenium but I cannot get past the step of opening Firefox. I am running python 3.10 on Windows 11.

Thank you all in advance!

Solution

The data comes from a xhr/fetch.
You can find it here:
https://poit.bolagsverket.se/poit/rest/HamtaKungorelse?kungorelseid=K397881/22

Answered By – pguardiario

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published