mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-14 15:09:23 +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 DEFAULT_HEADERS
|
||||
|
||||
domain = 'https://www.businesswire.com'
|
||||
|
||||
@@ -11,7 +12,7 @@ def parse(post):
|
||||
return item
|
||||
|
||||
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')
|
||||
items = list(map(parse, posts))
|
||||
items = filter_content(items)
|
||||
|
||||
Reference in New Issue
Block a user