Open normanvdmeijden opened 1 year ago
I have the same problem
same problem here, response 403 forbiden.
same problem.
Same!
@alvarobartt thanks for the update. Really appreciate all the work you have done and what you have made possible thusfar!
I've gotten the economic_calendar module working again by using the library cfscraper, and using that to make requests by adding
import cfscraper
to the imports and
scraper = cfscrape.create_scraper()
above the while True
loop, and then replacing req = requests.post(url, headers=headers, data=data)
with req = scraper.post(url, headers=headers, data=data)
I've gotten the economic_calendar module working again by using the library cfscraper, and using that to make requests by adding
import cfscraper
to the imports andscraper = cfscrape.create_scraper()
above thewhile True
loop, and then replacingreq = requests.post(url, headers=headers, data=data)
withreq = scraper.post(url, headers=headers, data=data)
@jazz-g it works with cfscrape. thanks for info.
@jazz-g Thanks, but when I tried this I am requested for a license key. any idea what I am doing wrong?
Hi! What a great community we have, thanks for the solution. @normanvdmeijden I believe you're importing the wrong module, it's supposed to be crscrape (not crscraper) Thanks for the solution @jazz-g
@jazz-g @Lontaren Yes it is up and running now, thanks for all the support
i need a little bit of help here. i am using below function. how do i get it using cfscrape exogs = investpy.economic_calendar(time_zone = "GMT", countries = ["United States"], importances = ['high','medium','low'],from_date= date_from, to_date = date_to)
@varshasahasrabuddhe You need to modify the investpy package (in this case the news.py file) with the code @jazz-g suggested
Thank you Lontaren and @jazz-g
@varshasahasrabuddhe You need to modify the investpy package (in this case the news.py file) with the code @jazz-g suggested
Thanks a ton! 🥇 this solved my issue :)
Hi guys,
Yesterday I could retrieve the calender info with any issues, trying it this morning (same code), I received the following error below. How can I fix this?
Traceback (most recent call last): File "C:\Users\vanderMeijden\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64qbz5n2kfra8p0\lib\json\init.py", line 346, in loads
return _default_decoder.decode(s) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "c:\Users\vanderMeijden\Desktop\EIA\EIACalender", line 28, in
calender = investpy.news.economic_calendar(from_date="19/10/2022", to_date="21/10/2022")
File "C:\Users\vanderMeijden\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\investpy\news.py", line 251, in economic_calendar
root = fromstring(req.json()["data"])
File "C:\Users\vanderMeijden\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Thanks, Norman