Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to deal with websites that dynamically insert/delete text with JavaScript? #1635

Open
tgf9 opened this issue Jan 18, 2025 · 2 comments

Comments

@tgf9
Copy link

tgf9 commented Jan 18, 2025

I'm trying to convert a website that has a lot of text, but also has these annoying <details>-like boxes. I checked the HTML and I can see they're actually <div> elements with, I guess, a click handler. When I click the div, text gets added to a child <div> element. This looks like I'm opening the <details>-like element. When I click again, JS deletes text in the child <div> element. This looks like I'm closing the <details>-like element.

It's pretty annoying because there's a ton of text hidden in these boxes that is missing from the resulting epub. I understand why it's missing (it's literally not in the HTML until you click a button), but rather I'm wondering if there is anything I can do about this situation.

Is there a way I could manually click on the boxes to add the child text to the page and then have WebToEpub process that HTML?

@gamebeaker
Copy link
Collaborator

At the moment it is not possible.

@dteviot
Copy link
Owner

dteviot commented Jan 21, 2025

@tgf9

It's possible that the text is elsewhere on the web page. Probably buried in one or more <script> elements.
In which case, it should be possible to make a parser for the site that will scan the page, find the various text elements and stitch them together.

Note, it's also possible the text is elsewhere, or encrypted in which case it may not be possible to solve for WebToEpub.

If you can provide me with a URL, I can look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants