Website Content Crawler avatar
Website Content Crawler
Try for free

No credit card required

View all Actors
Website Content Crawler

Website Content Crawler

apify/website-content-crawler
Try for free

No credit card required

Automatically crawl and extract text content from websites with documentation, knowledge bases, help centers, or blogs. This Actor is designed to provide data to feed, fine-tune, or train large language models such as ChatGPT or LLaMA.

User avatar

hyperlinks in markdown are broken

Open

craftspeople opened this issue
2 months ago

when exporting the results of a scrape, the markdown has broken hyperlinks such as:

[

Admin & Relations

](/careers_category/admin-relations)

is it possible to remove the unwanted space after [ and before ] so that the markdown is as expected?

User avatar

Hello, and thank you for your interest in the Actor!

Website Content Crawler uses the Turndown library to convert from HTML to markdown. I have verified that the library behaves like you describe:

1import TurndownService from 'turndown';
2const str = `<a href="/careers/career-fields/admin-relations" class="promo-box tab-focus" style="background-image: url(&quot;https://content.nationalguard.com/sites/default/files/adminrelations2023.jpg&quot;);"><div class="inner"><h4 class="promo-title">Admin &amp; Relations</h4> <h6>
3         Learn more.
4         <i class="fas fa-chevron-right" aria-hidden="true"></i></h6></div> <div class="overlay"></div></a>`;
5const td = TurndownService({headingStyle: 'atx', codeBlockStyle: 'fenced'});
6td.turndown(str); // returns broken markdown link

I'm afraid that there is nothing we can do on our end. You can open an issue with turndown (https://github.com/mixmark-io/turndown), or you could remove the offending links completely with the removeElementsCssSelector option. Or you could ignore the markdown produced by Website Content Crawler and perform the conversion using a different tool after you download the dataset (using the HTML as input - you need to enable that with the "Save HTML" option).

Hope that helps!

Developer
Maintained by Apify
Actor metrics
  • 2k monthly users
  • 99.6% runs succeeded
  • 3.2 days response time
  • Created in Mar 2023
  • Modified 7 days ago