google-trends icon indicating copy to clipboard operation
google-trends copied to clipboard

Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException'

Open Evgeny-Ru opened this issue 8 years ago • 8 comments

Hi, @jonasva, thank's for GT API.

When I try to execute the code

require ('vendor/autoload.php');

use Jonasva\GoogleTrends\GoogleSession;
use Jonasva\GoogleTrends\GoogleTrendsResponse;
use GuzzleHttp\Exception\BadResponseException;

$config = [
    'email' =>  '[email protected]',
    'password' =>  'xxxx',
    'recovery-email'  =>  'xxxx'
];

$session = (new GoogleSession($config))->authenticate();

I'm getting the error

Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error response [url] https://accounts.google.com/CheckCookie?chtml=LoginDoneHtml [status code] 400 [reason phrase] Bad Request' in /home/ubuntu/workspace/dba/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 89 GuzzleHttp\Exception\ClientException: Client error response [url] https://accounts.google.com/CheckCookie?chtml=LoginDoneHtml [status code] 400 [reason phrase] Bad Request in /home/ubuntu/workspace/dba/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 89 Call Stack: 0.0023 236712 1. {main}() /home/ubuntu/workspace/dba/dbaQueryToGT.php:0 0.0093 410440 2. Jonasva\GoogleTrends\GoogleSession->authenticate() /home/ubuntu/workspace/dba/dbaQueryToGT.php:17 0.7901 997848 3. GuzzleHttp\Client->get() /home/ubuntu/workspace/dba/vendor/jonasva/google-trends/src/Jonasva/GoogleTrends/GoogleSession.php:270 0.7904 1009608 4. GuzzleHttp\Client->send() /home/ubuntu/workspace/dba/vendor/guzzlehttp/guzzle/src/Client.php:204

Also, Google notify me about the ban

If the error with Guzzle arose from the ban, is there some way to fix it?

Thank's in advance.

Evgeny-Ru avatar Apr 08 '16 05:04 Evgeny-Ru

The same happened to me, though without the ban.

Any ideas?

omergisha avatar Apr 20 '16 08:04 omergisha

Google changed their login process a little bit, I'm working on updating the bundle to cope with that. Will have an update soon.

jonasva avatar Apr 20 '16 09:04 jonasva

The same error.

sircovsw avatar May 05 '16 14:05 sircovsw

having same issue, working fine on localhost but error on live server. if any one have alternate for this please mention. Thanks

tanxeel avatar Jul 11 '16 17:07 tanxeel

Hey @jonasva Do you plan to update the task?

serjgamover avatar Dec 10 '16 12:12 serjgamover

Hola @jonasva, news?

Epizefiri avatar Feb 03 '17 13:02 Epizefiri

This is not working anymore and the author doesn't look like is going to fix it. For who may interest, there is a working php library for google trends api that works pretty well. It has the same features than this library and some more.

mazard avatar Apr 18 '17 19:04 mazard

Google changed their login process a little bit, I'm working on updating the bundle to cope with that. Will have an update soon.

Thanks (no) for updates!!!!

ReymOleg avatar Jun 05 '19 12:06 ReymOleg