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

iter_list_member with await #232

Open
HamedAkhavan opened this issue Dec 1, 2024 · 5 comments
Open

iter_list_member with await #232

HamedAkhavan opened this issue Dec 1, 2024 · 5 comments

Comments

@HamedAkhavan
Copy link

HamedAkhavan commented Dec 1, 2024

Hi,
I'm running iter_list_member and my code is not async and I get the following error:

File "/usr/local/lib/python3.10/site-packages/tweety/init.py", line 21, in wrapper
return loop.run_until_complete(coro)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/usr/local/lib/python3.10/site-packages/tweety/utils.py", line 73, in wrapper
return await func(self, *args, **kwargs)
TypeError: object async_generator can't be used in 'await' expression

tweety version: 2.0.6 from pypi

@mahrtayyab
Copy link
Owner

can you please post your code snippet

@HamedAkhavan
Copy link
Author

@mahrtayyab this is my code:

proxy_ = get_proxy()
proxy = Proxy(
    host=proxy_["host"],
    port=proxy_["port"],
    proxy_type=PROXY_TYPE_SOCKS5,
    username=proxy_["username"],
    password=proxy_["password"],
)
app = Twitter(scraper_account.username, proxy=proxy)
app.sign_in(
	scraper_account.username,
	scraper_account.password,
	extra={
	    "enter_phone": scraper_account.phone,
	    "enter_text": scraper_account.phone,
	},
)
app.iter_list_member("220100704", 10000)

@mahrtayyab
Copy link
Owner

#223 (comment)

@mahrtayyab
Copy link
Owner

You can use get_list_member

@HamedAkhavan
Copy link
Author

@mahrtayyab thanks, but how to get one page at a time instead of getting all pages using get_list_member?

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