简体   繁体   中英

Parsing tag data from HTML using JSoup in Java

How would I parse 46389333 out of the following html?

 <a href="/exampleTweet/status/46389333"

I'm using JSoup, and I can parse text, tags, and other values obviously. But I can't quite figure out how to parse out that value. Even if I could only parse out /exampleTweet/status/46389333, then at least I could parse that string, a lot easier. Problem is, the number changes, and so does exampleTweet obviously. Status stays there though, so maybe I could use that somehow? Any help would be great.

Decided to go with just using the Element's "toString()" function, and then delimiting that string. Hope this helps someone out in the future!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM