We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there,
For whatever reason, the self.data['browsers']/self.data_browsers[browser] has only keys, no values,
{u'chrome': [], u'opera': [], u'firefox': [], u'internetexplorer': [], u'safari': []}
Therefore our production cron is broken due to this error
raise FakeUserAgentError('Error occurred during getting browser') # noqa
So I am asking you to return a default browser if choice is empty. i.e in line https://github.com/hellysmile/fake-useragent/blob/master/fake_useragent/fake.py#L136
if not self.data_browsers[browser]: return random.choice(['firefox', 'chrome', 'opera', 'safari']) # i.e a fallback list return random.choice(self.data_browsers[browser])
Hope you can give a better solution.
The text was updated successfully, but these errors were encountered:
It was fixed yesterday, at version 0.1.8! Can You try to update?
Sorry, something went wrong.
Oh, didn't notice this and created a PR, going to try now :) And it works.
No branches or pull requests
Hi there,
For whatever reason, the self.data['browsers']/self.data_browsers[browser] has only keys, no values,
Therefore our production cron is broken due to this error
So I am asking you to return a default browser if choice is empty.
i.e in line https://github.com/hellysmile/fake-useragent/blob/master/fake_useragent/fake.py#L136
Hope you can give a better solution.
The text was updated successfully, but these errors were encountered: