codelucas / newspaper

newspaper3k is a news, full-text, and article metadata extraction in Python 3. Advanced docs:
https://goo.gl/VX41yK
MIT License
14.17k stars 2.12k forks source link

How to use headers when requesting in Article()func? #844

Open chengzi0103 opened 4 years ago

chengzi0103 commented 4 years ago

HELLO : my use Article func , but my request need headers or i need User-Agent in Article func ? news = Article(url, language='zh',headers =headers) news.download() news.parse()

johnbumgarner commented 4 years ago

I recently started putting together a detailed Newspaper3k usage document that I'm publicly sharing. This document is available here: https://github.com/johnbumgarner/newspaper3_usage_overview. It contains details on how to use headers with Newspaper3k.

P.S. this document is a work in process, so more information will be added.