File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 413413.. code-block::
414414 :class: thebe, thebe-init
415415
416- adv.sitemap_to_df("https://www.ft.com/sitemaps/news.xml", headers ={"User-agent": "YOUR-USER-AGENT"})
416+ adv.sitemap_to_df("https://www.ft.com/sitemaps/news.xml", request_headers ={"User-agent": "YOUR-USER-AGENT"})
417417
418418Another interesting thing you might want to do is utilize the `If-None-Match` header.
419419In many cases the sitemaps return an etag for the sitemap. This is to make it easier to
438438 etag = ft['etag'][0]
439439
440440 # Second time:
441- ft = adv.sitemap_to_df("https://www.ft.com/sitemaps/news.xml", headers ={"If-None-Match": etag})
441+ ft = adv.sitemap_to_df("https://www.ft.com/sitemaps/news.xml", request_headers ={"If-None-Match": etag})
442442""" # noqa: E501
443443
444444import logging
You can’t perform that action at this time.
0 commit comments