Comments (5)
Hi @ReySadeghi I have trouble downloading the page as well with Python, I'm afraid this problem exceeds the scope of the library.
This solution works on the command-line:
wget -O - "https://www.isna.ir/news/1400070704627/%D8%AA%D8%B5%D8%A7%D9%88%DB%8C%D8%B1-%D8%AE%D8%A7%D8%B1%D9%82-%D8%A7%D9%84%D8%B9%D8%A7%D8%AF%D9%87-%D8%A7%D8%B2-%D8%B2%D9%85%DB%8C%D9%86-%DA%A9%D9%87-%D8%AA%D9%88%D8%B3%D8%B7-%D9%85%D8%A7%D9%87%D9%88%D8%A7%D8%B1%D9%87-%D9%84%D9%86%D8%AF%D8%B3%D8%AA-%D8%AB%D8%A8%D8%AA-%D8%B4%D8%AF%D9%87-%D8%A7%D9%86%D8%AF" | trafilatura
from trafilatura.
Hi @ReySadeghi, I cannot reproduce the bug with standard extraction, are you using the latest version of the software and are you using particular options?
from trafilatura.
yes, I used version of 1.3.0
my code is this:
import trafilatura
downloaded = trafilatura.fetch_url(url)
json_file=trafilatura.bare_extraction(downloaded, include_links=True)
#json_file= trafilatura.extract(downloaded, output_format='json')
date=json_file['date']
from trafilatura.
Hi @ReySadeghi, thanks for the additional info. I still cannot reproduce the error, I think there are two explanations here:
- The line where you run the extraction with
output_format='json'
is commented out... So there is nodate
attribute in the result (which is a string). - The download didn't work and no error has been caught, so there is no result in the end, which triggers the error. For more on downloads see this docs section
Does that solve your problem?
from trafilatura.
Hi again,
thanks for your response.
also I tried both methods : "bare_extraction" and "extract",
but I couldn't download and got the Error.
I tried download section that you mentioned, but nothing happen.
I think maybe my URL is under restriction by trafilatura.
I also tried with vpn but it doesn't solve.
could you please try to download this URL:
from trafilatura.
Related Issues (20)
- ValueError: signal only works in main thread HOT 2
- Proxy support to Trafilatura HOT 4
- Headers with classes dont get detected HOT 1
- Paras get broken up into fragments HOT 3
- Doesn't detect bullet points within tables HOT 4
- Simple HTML processing issue? HOT 4
- Unnecessary Comments LOG INFO HOT 1
- Codeblock Markdown formatting is missing HOT 1
- Cannot extract Heading tags HOT 26
- [1.6.0] New Content Hashes HOT 2
- Restrictions on Web Crawling HOT 2
- Unable to extract metadata w/o authors `additionalName`
- More robust backup parsing HOT 1
- Gooey dependency seems unmaintained and broken HOT 1
- Function to use part of the heuristics on bare HTML fragments
- metadata extraction problem HOT 8
- XMLSyntaxError during conversion to XML output HOT 1
- Option to convert relative links HOT 1
- Doesn't seem to work with recent charset-normalizer HOT 2
- Check URLs passed to courlan functions `extract_links` and `fix_relative_urls` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trafilatura.