Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
195 views
in Technique[技术] by (71.8m points)

java - How to scrape this image using JSOUP

I'm trying to scrape this image using jsoup.

http://zjcdn.mangafox.me/store/manga/16627/114.0/compressed/s001.jpg?token=nYL050P9BCH5N_tE2hN4RuZXvCCAYkAr5pEQbApF6UU

I tried selecting the image tag using getElementsByTag("img") but that doesn't return any elements.

Then, I tried downloading straight from this link but that returned an empty image.

Any solutions would be highly appreciated.

question from:https://stackoverflow.com/questions/65901723/how-to-scrape-this-image-using-jsoup

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Download directly from this link:

http://zjcdn.mangafox.me/store/manga/16627/114.0/compressed/s001.jpg

In your code, when finding similar hyperlinks, remove everything after an image extension (.jpg, .png, ..). Such as this:

?token=nYL050P9BCH5N_tE2hN4RuZXvCCAYkAr5pEQbApF6UU

This second part is the issue here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...