crux icon indicating copy to clipboard operation
crux copied to clipboard

the extracted content output not contain picture elements

Open wizos opened this issue 5 years ago • 8 comments

wizos avatar Jul 05 '18 03:07 wizos

Please include more details, including:

  1. A specific URL that demonstrates the problem.
  2. The exact markup downloaded from that URL by a JavaScript-disabled User Agent, e.g. wget or curl.
  3. What you expected to see.
  4. What you actually saw.

chimbori avatar Oct 19 '18 06:10 chimbori

I think they just mean that the extracted text doesn't have the original images within the text - is there a way to do this?

platelminto avatar Nov 08 '18 17:11 platelminto

<img> elements should be included in the output DOM, so if they're not, then it needs to be debugged. Different sites have different markup, so it's hard to debug without a test case.

OP hasn't replied in a long time, but if you have an example URL + markup, please attach it here.

chimbori avatar Nov 08 '18 17:11 chimbori

https://www.wired.com/story/bitcoin-will-burn-planet-down-how-fast/ Gist for Crux output

platelminto avatar Nov 08 '18 17:11 platelminto

@chimbori is this being worked on? Still not getting any tags

platelminto avatar Nov 20 '18 01:11 platelminto

Not being actively worked on, no. I’ll look into it if/when I have a chance, but the reason I asked for more documentation is that others who see this issue could have enough information to get started.

chimbori avatar Nov 20 '18 19:11 chimbori

If anyone does look at this, the reason it doesn't work is because some sites load some of their images lazily with JavaScript, and the HTML you are providing is likely the one before the images are inserted. To fix this, the JavaScript must first be run, then provide that HTML to Crux - this can be done with something like HtmlUnit, but that library doesn't work on Android.

Still trying to find a solution to that, though that might be out of the scope of Crux - with the post-JavaScript HTML, it works fine.

platelminto avatar Nov 21 '18 10:11 platelminto

Am now working on this - by the way, where is the code that should make the elements included in the output DOM? I couldn't find any, had to add my own to get any working - when I pass all the tests, I'll submit a merge request.

platelminto avatar Nov 30 '18 14:11 platelminto