Scrape JSON response

Posted almost 7 years ago by ivajason

Post a topic
Answered
i
ivajason

Is there a way to use Portia to scrape a JSON response?

0 Votes

nestor

nestor posted almost 7 years ago Admin Best Answer

Unfortunately, Splash cannot render that URL so it won't be possible to scrape with Portia. JSON responses are possible to scrape as long as Portia is able to render as HTML.

0 Votes


7 Comments

Sorted by
nestor

nestor posted almost 7 years ago Admin

@rpm61 Enable JS in Portia and when you run the spider in Scrapinghub it should extract the JSON response.

0 Votes

r

rpm61 posted almost 7 years ago

Is that why I can't seem to get any items out of this rather simple JSON response using regex? 


https://jsonplaceholder.typicode.com/posts/1


I do get the response to load from this url, but my annotations produce no items, it starts trying to extract and just keeps spinnin'. Is there some trick to annotations on straight JSON, or does everything need to be framed in HTML?

0 Votes

nestor

nestor posted almost 7 years ago Admin Answer

Unfortunately, Splash cannot render that URL so it won't be possible to scrape with Portia. JSON responses are possible to scrape as long as Portia is able to render as HTML.

0 Votes

nestor

nestor posted almost 7 years ago Admin

What's the URL?

0 Votes

B

Bob Kolo posted almost 7 years ago

How is this done? I am getting no response from a url that returns json in chrome.

0 Votes

nestor

nestor posted almost 7 years ago Admin

Yeah, it is possible to extract JSON response using Portia.

0 Votes

Login to post a comment