Skip to content
New issue

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

Don't understand how to use any of the ProfileManager functions #25

Closed
gameuser1982 opened this issue Dec 24, 2023 · 3 comments
Closed

Comments

@gameuser1982
Copy link

gameuser1982 commented Dec 24, 2023

Description

The scraping stuff is all clear to me as I have experience with Selerium (And the Beautiful Soup stuff wasn't too bad either), but I am not getting how to properly use anything here: https://github.com/omkarcloud/botasaurus?tab=readme-ov-file#i-have-automated-the-creation-of-user-accounts-now-i-want-to-store-the-user-account-credentials-like-email-and-password-how-to-store-it

Steps to Reproduce

Here's the script its only purpose is to grasp how to use these functions

from botasaurus import *

user = bt.generate_user(country=bt.Country.IN)
print(user)
bt.Profile.set_profile(user)
bt.Profile.set_item("api_key", "BDEC26")
profiles = bt.Profile.get_all_profiles()
print(profiles)

Expected behavior: Save user data in a Chrome profile?

Actual behavior: [What actually happens]

Traceback (most recent call last):
File "C:\py311botasaurus\btprofiles.py", line 5, in
bt.Profile.set_profile(user)
File "C:\py311botasaurus\py311botasaurus\Lib\site-packages\botasaurus\profile.py", line 146, in set_profile
self.check_profile()
File "C:\py311botasaurus\py311botasaurus\Lib\site-packages\botasaurus\profile.py", line 83, in check_profile
raise Exception('This method can only be run in run method of Task and when you have given the current profile in the Browser Config.')
Exception: This method can only be run in run method of Task and when you have given the current profile in the Browser Config.

Reproduces how often: [What percentage of the time does it reproduce?]

Every time. I have no idea how to use anything here: https://github.com/omkarcloud/botasaurus?tab=readme-ov-file#i-have-automated-the-creation-of-user-accounts-now-i-want-to-store-the-user-account-credentials-like-email-and-password-how-to-store-it

Additional context

@gameuser1982 gameuser1982 changed the title Don Don't understand how to use any of the ProfileManager functions Dec 24, 2023
@Chetan11-dev
Copy link
Contributor

Yeah Docs need Improvement, For now read https://www.omkar.cloud/botasaurus/docs/sign-up-tutorial/ to understand the logic.

@gameuser1982
Copy link
Author

Thanks! This should and actually your docs are overall excellent especially when compared to the Selerium docs!

@Chetan11-dev
Copy link
Contributor

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants