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

Unable to extract code block in HTML page #222

Open
twelveand0 opened this issue Nov 4, 2024 · 0 comments
Open

Unable to extract code block in HTML page #222

twelveand0 opened this issue Nov 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@twelveand0
Copy link

twelveand0 commented Nov 4, 2024

When I try to extract the content from a webpage using docling, I found it cannot extract code blocks in the webpage.

Reproduce steps

HTML URL: https://requests.readthedocs.io/en/latest/user/quickstart/

from docling.document_converter import DocumentConverter

converter = DocumentConverter()
result = converter.convert('https://requests.readthedocs.io/en/latest/user/quickstart/')
print(result.document.export_to_markdown())

The code blocks in the following picture cannot be extracted in the result markdown:
image

The result markdown of this part in the above picture is :

## Make a Request¶

Making a request with Requests is very simple.

Begin by importing the Requests module:

Now, let’s try to get a webpage. For this example, let’s get GitHub’s public
timeline:

Now, we have a Response object called r. We can
get all the information we need from this object.

Requests’ simple API means that all forms of HTTP request are as obvious. For
example, this is how you make an HTTP POST request:

Nice, right? What about the other HTTP request types: PUT, DELETE, HEAD and
OPTIONS? These are all just as simple:

That’s all well and good, but it’s also only the start of what Requests can
do.
@cau-git cau-git added the bug Something isn't working label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants