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

await google.search(file=file)的返回值中的raw为空列表 #246

Closed
RE112233 opened this issue Jan 16, 2025 · 2 comments
Closed

await google.search(file=file)的返回值中的raw为空列表 #246

RE112233 opened this issue Jan 16, 2025 · 2 comments

Comments

@RE112233
Copy link

您好,非常感谢您的库为我的工作带来很多便利,但最近我遇到了一个问题。
`@logger.catch()
async def shape_async(file) -> GoogleResponse:
max_retries = 5
retry_count = 0
retry_delay = 5 # 重试间隔时间(秒)
consoleAndFileLogger.info(f"dealing:{file}")

while retry_count < max_retries:
    try:

        async with Network(proxies=PROXIES) as client:
            google = Google(client=client)
            resp = await google.search(file=file)

`
其中的变量resp
image
raw中没有值,但我点击resp.url是可以正常访问的
https://www.google.com/search?tbs=sbi:AMhZZiuoUpVZZcjPPKtVZzbEgC3SC0Or24gg8MTnFn5wHAu2YXtTXGKiwf0ih2qOThLZPZ7KBeYhAO-2MXVtSwKFoGmByvhfh-aK_1BEehAEJ4ayfG9nv1C4jxOwRLZEw-IuCqLVV0QtHaFKqNFWDbQVeo1BJxR5kZqwJ3LRkFXB0VtCCyqMJbqhvGX4u3SK0m1j2O8ogw4VKwq4Of4eU64NmcRJQKHKtfYGpokdqtjP-JzCoKPxvOklmr0oPPhyYKl05YIvHF-gtrIJZ0CbcU4PtAGQ_1zmsZjsMPV-349SzFRyUPe61WVKpVuKXapkJRf0CYmzUoBONE&safe=off
image
我尝试更换我的代理ip仍没有解决。

@NekoAria
Copy link
Collaborator

NekoAria commented Jan 17, 2025

目前看起来似乎没有轻量级的解决方案,因为 Google 似乎已加入了反机器人机制,导致返回的内容发生了变化,无法像之前那样直接获取数据了。

我在周三时还能够正常使用,现在已经无法使用了。

@NekoAria
Copy link
Collaborator

NekoAria commented Jan 22, 2025

没想到解决这个问题比我预想的还要简单,只需要传入一个包含 NID 的 cookies 即可。

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