Python Edgar asks for useragent

1.3k Views Asked by At

I ran the following command:

import edgar
import pandas as pd
edgar.download_index('/Users/myusername/Desktop/Desktop', 2010,skip_all_present_except_last=False)

It's throwing the following error asking for user_agent. Please clarify where can I get that useragent and guide if I am getting wrong on anything else? The error message is:

TypeError                                 Traceback (most recent call last)
<ipython-input-7-95d304376aa1> in <module>
      1 import edgar
      2 import pandas as pd
----> 3 edgar.download_index('/Users/myusername/Desktop/Desktop', 2010,skip_all_present_except_last=False)

TypeError: download_index() missing 1 required positional argument: 'user_agent'
1

There are 1 best solutions below

0
On

According to the package documentation, there is a user_agent parameter. This parameter is mandatory. The given example is "MyCompany [email protected]"

Try:

edgar.download_index('/Users/myusername/Desktop/Desktop', 2010, "your_name [email protected]", skip_all_present_except_last=False)