Get text from a <p> with specific id in Android using Jsoup

Kennedy Kambo

I want to fetch some data from my website using Jsoup in my webview. The website is still in development so I can't post any code but here's what I want to achieve:

So the user visits the website where all data I require in the app is loaded onto one page. So I want to fetch all that data as separate strings and use them to fill my table layout. The website has all that I want with each string in a p tag with a unique id.

How can I achieve this? I already have jsoup installed but I can't get my head around how to use it.

PHPFan

Generally if you want to extract element that has id so use select(element_name#id_name)

To extract text that element involves it use .text()

Again show us the html part you want to extract the text from

So try this code

try {
    Document doc = Jsoup.connect("your url").get();
    System.out.println(doc.select("p#id_name").text());
} catch (Exception e) {
    e.printStackTrace();
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Jsoup how to get specific Text

From Dev

JSOUP using Nodes to get specific text that is outside HTML tags

From Dev

Jsoup how to get text from a specific column of an html table

From Dev

Extract text from html string using Jsoup with specific encoding

From Dev

get specific data from website using JSOUP in Java?

From Dev

Get text without tags from web page using Jsoup

From Dev

Using Jsoup in Android to get data from select element

From Dev

Android - Get specific text from TextView

From Dev

Get specific text from textbox using regexp

From Dev

how to get a specific div using jsoup

From Dev

how to get a specific div using jsoup

From Dev

How to get the specific information from an element in JSOUP?

From Dev

Select <p> from HTML using Jsoup

From Dev

Jsoup get text from div class

From Dev

Getting text from a website using JSoup

From Dev

How to extract text from wikipedia using Jsoup?

From Dev

How to extract text from wikipedia using Jsoup?

From Dev

Trouble grabbing text from a website using Jsoup

From Dev

Get text from a URL using Android HttpURLConnection

From Dev

Can't get text and link from website html parsing using jsoup

From Dev

Can't get website using jsoup on Android

From Dev

Get data from table using jSoup

From Dev

How to get the push id of a specific value in android using firebase

From Dev

How to extract text from specific rows in nested tables with Jsoup

From Java

Get specific line from text file using just shell script

From Dev

Using sed to get specific text from XML file

From Dev

Not able to get the count of a specific ID from a json using angularjs

From Dev

How to get direct link of remote video from embedded url within a url in Android using JSoup?

From Dev

How to select <p> tag of a div tag using JSoup in android

Related Related

  1. 1

    Jsoup how to get specific Text

  2. 2

    JSOUP using Nodes to get specific text that is outside HTML tags

  3. 3

    Jsoup how to get text from a specific column of an html table

  4. 4

    Extract text from html string using Jsoup with specific encoding

  5. 5

    get specific data from website using JSOUP in Java?

  6. 6

    Get text without tags from web page using Jsoup

  7. 7

    Using Jsoup in Android to get data from select element

  8. 8

    Android - Get specific text from TextView

  9. 9

    Get specific text from textbox using regexp

  10. 10

    how to get a specific div using jsoup

  11. 11

    how to get a specific div using jsoup

  12. 12

    How to get the specific information from an element in JSOUP?

  13. 13

    Select <p> from HTML using Jsoup

  14. 14

    Jsoup get text from div class

  15. 15

    Getting text from a website using JSoup

  16. 16

    How to extract text from wikipedia using Jsoup?

  17. 17

    How to extract text from wikipedia using Jsoup?

  18. 18

    Trouble grabbing text from a website using Jsoup

  19. 19

    Get text from a URL using Android HttpURLConnection

  20. 20

    Can't get text and link from website html parsing using jsoup

  21. 21

    Can't get website using jsoup on Android

  22. 22

    Get data from table using jSoup

  23. 23

    How to get the push id of a specific value in android using firebase

  24. 24

    How to extract text from specific rows in nested tables with Jsoup

  25. 25

    Get specific line from text file using just shell script

  26. 26

    Using sed to get specific text from XML file

  27. 27

    Not able to get the count of a specific ID from a json using angularjs

  28. 28

    How to get direct link of remote video from embedded url within a url in Android using JSoup?

  29. 29

    How to select <p> tag of a div tag using JSoup in android

HotTag

Archive