How to parse images in json from html page

Иван Якушев

I need to parse images from 500px and show it in my android application. But all trys get me an error: "json parse error unrecognized token '<'". How can i fetch just src for images?

I don't know much about this, serfing internet don't help at all, try a bunch of combinations using fetch function.

webCall=()=>{

        return fetch('https://500px.com/popular')
               .then((response) => response.json())
               .then((responseJson) => {
                 this.setState({
                   isLoading: false,
                   dataSource: responseJson
                 }, function() {
                   // In this block you can do something with new state.
                 });
               })
               .catch((error) => {
                 console.error(error);
               });

       }

Tanner

https://500px.com/popular returns an HTML page, not an image. The unrecognized token '<' refers to the first character of the opening tag received from the page (likely <!DOCTYPE>. Parsing HTML as JSON doesn't work.

It looks like 500px closed their public API recently, so you might be out of luck.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to parse JSON from HtmlWebResponseObject

分類Dev

How to parse a list of Integers from a JSON object

分類Dev

How to parse JSON response from Rest API

分類Dev

Xamarin: How to get HTML from page in WebView?

分類Dev

How can i parse url from iframe html code?

分類Dev

How to import images from JSON data into create-react-app

分類Dev

How to prepend html into on page element from HTML onClick event?

分類Dev

How to parse an infinite json array from stdin in go?

分類Dev

How to parse JSON array from a GET request in react-native?

分類Dev

How to parse a JSON path with a "@" in it?

分類Dev

How to parse <p> in JSON

分類Dev

how to parse this in android with json

分類Dev

How transfer a string (not from form) from HTML page to the server?

分類Dev

Why I cannot parse this HTML page in Python?

分類Dev

Scraper unable to parse content from first page

分類Dev

How to dispaly values from a different html page using javascript?

分類Dev

How to get data from dynamic elements that added to the html page?

分類Dev

How to serve a Python pickle file from a HTML page

分類Dev

how to extract text from a parsed html page in pandas

分類Dev

How to extract String (from Java code) into HTML page?

分類Dev

Android - How to get plain HTML using evaluateJavascript from Webview? JSOUP not able to parse the result HTML

分類Dev

How to add images in an html file?

分類Dev

How to Parse HTML using php?

分類Dev

How to parse the json array in golang?

分類Dev

How to parse json array with ajax?

分類Dev

How to parse json file in Octave?

分類Dev

How to parse complex JSON in haskell

分類Dev

How to parse json and create table with it?

分類Dev

How to include images in page post API

Related 関連記事

  1. 1

    How to parse JSON from HtmlWebResponseObject

  2. 2

    How to parse a list of Integers from a JSON object

  3. 3

    How to parse JSON response from Rest API

  4. 4

    Xamarin: How to get HTML from page in WebView?

  5. 5

    How can i parse url from iframe html code?

  6. 6

    How to import images from JSON data into create-react-app

  7. 7

    How to prepend html into on page element from HTML onClick event?

  8. 8

    How to parse an infinite json array from stdin in go?

  9. 9

    How to parse JSON array from a GET request in react-native?

  10. 10

    How to parse a JSON path with a "@" in it?

  11. 11

    How to parse <p> in JSON

  12. 12

    how to parse this in android with json

  13. 13

    How transfer a string (not from form) from HTML page to the server?

  14. 14

    Why I cannot parse this HTML page in Python?

  15. 15

    Scraper unable to parse content from first page

  16. 16

    How to dispaly values from a different html page using javascript?

  17. 17

    How to get data from dynamic elements that added to the html page?

  18. 18

    How to serve a Python pickle file from a HTML page

  19. 19

    how to extract text from a parsed html page in pandas

  20. 20

    How to extract String (from Java code) into HTML page?

  21. 21

    Android - How to get plain HTML using evaluateJavascript from Webview? JSOUP not able to parse the result HTML

  22. 22

    How to add images in an html file?

  23. 23

    How to Parse HTML using php?

  24. 24

    How to parse the json array in golang?

  25. 25

    How to parse json array with ajax?

  26. 26

    How to parse json file in Octave?

  27. 27

    How to parse complex JSON in haskell

  28. 28

    How to parse json and create table with it?

  29. 29

    How to include images in page post API

ホットタグ

アーカイブ