Skip to content
Advertisement

Python Scrap Same item from all subpages using BeautifulSoup

I am trying to scrap “salary” from each subpage. For one of the subpage, I am copying the specific contents of the soup =BeautifulSoup(requests.get('url_of_job').text. I copied soup content to a word file and sliced the content surrounding salary and copied here. Copying all text crosses the limit here.

soup =

JavaScript

My code:

JavaScript

Present solution:

JavaScript

Expected solution:

JavaScript

Advertisement

Answer

Here is a solution which allows you to programmatically access that job’s info:

JavaScript

This will print in terminal:

JavaScript

Of course you can drill down into that json object, and select more details about the job. BeautifulSoup docs: https://beautiful-soup-4.readthedocs.io/en/latest/index.html

Advertisement