Reputation:
I am using scrapy json.load(response.body)
and we found JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Upvotes: 0
Views: 199
Reputation: 799
if you haven't notice your text starts from jQuery112404923709263392255_1547626291787
due to this line, string can't be converted to json
Try using this simple regex
to get the json
string and then parse it to json.loads()
r'\(({.*)\);' #it caputures anything starts from `{` and ends with `);`
Upvotes: 1
Reputation: 3717
You have JS callback in your response. Try to remove extra variables from your url like https://www.magellanprovider.com/ProviderSearchGateway/sessions/52229928/providers.jsonp?start=1&end=100
or use regex to cut json from response text.
Upvotes: 0