Skip to content
Advertisement

Tag: beautifulsoup

Convert html table to json with BeautifulSoup

I am trying to convert HTML table to json using beautifulsoup() function python, I was able to convert but the data coming in wrong json format. The above code prints JSON in the below format. I would like to get it in below format Some help is appreciated Answer The output you want is not a valid format, so you

Looping through HTML & following links

I am writing a code that is supposed to open a url, identify the 3rd link and repeat this process 3 times (each time with the new url). I wrote a loop (below), but it seems to each time sart over with the original url. Can someone help me fix my code? Answer You need to define the empty list

Advertisement