mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-17 15:09:31 +00:00
add headers when fetching businesswire
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
from rsshub.utils import fetch, filter_content
|
from rsshub.utils import fetch, filter_content
|
||||||
|
from rsshub.utils import DEFAULT_HEADERS
|
||||||
|
|
||||||
domain = 'https://www.businesswire.com'
|
domain = 'https://www.businesswire.com'
|
||||||
|
|
||||||
@@ -11,7 +12,7 @@ def parse(post):
|
|||||||
return item
|
return item
|
||||||
|
|
||||||
def ctx(category=''):
|
def ctx(category=''):
|
||||||
tree = fetch(f"{domain}/portal/site/home/template.PAGE/news/")
|
tree = fetch(f"{domain}/portal/site/home/template.PAGE/news/", headers=DEFAULT_HEADERS)
|
||||||
posts = tree.css('.bwNewsList li')
|
posts = tree.css('.bwNewsList li')
|
||||||
items = list(map(parse, posts))
|
items = list(map(parse, posts))
|
||||||
items = filter_content(items)
|
items = filter_content(items)
|
||||||
|
|||||||
Reference in New Issue
Block a user