Giter Site home page Giter Site logo

Getting Login Error about pytrends HOT 8 CLOSED

patrick-ogrady avatar patrick-ogrady commented on August 17, 2024
Getting Login Error

from pytrends.

Comments (8)

TiesdeKok avatar TiesdeKok commented on August 17, 2024

I am having the same issue since today, I suspect that google changed the login page in some way.

Update:
After looking at the source code of the login page I noticed that something minor changed.
Fortunately this is an easy fix (for now at least):

Fix it by changing line 64 in pyGTrends.py from

galx = re.compile('<input name="GALX"[\s]+type="hidden"[\s]+value="(?P<galx>[a-zA-Z0-9_-]+)">')

To:

galx = re.compile('<input type="hidden"[\s]+name="GALX"[\s]+value="(?P<galx>[a-zA-Z0-9_-]+)">')

In case the type and name arguments are going to be switching around frequently something like this might be a better solution:

Change line 64 - line 67 in pyGTrends.py from

galx = re.compile('<input name="GALX"[\s]+type="hidden"[\s]+value="(?P<galx>[a-zA-Z0-9_-]+)">')
m = galx.search(resp)
if not m:
    raise Exception('Cannot parse GALX out of login page')

To:

galx = re.compile('<input name="GALX"[\s]+type="hidden"[\s]+value="(?P<galx>[a-zA-Z0-9_-]+)">')
m = galx.search(resp)
if not m:
    galx = re.compile('<input type="hidden"[\s]+name="GALX"[\s]+value="(?P<galx>[a-zA-Z0-9_-]+)">')
    m = galx.search(resp)
    if not m:
        raise Exception('Cannot parse GALX out of login page')

from pytrends.

patrick-ogrady avatar patrick-ogrady commented on August 17, 2024

I am still getting the issue...did you test this?

from pytrends.

TiesdeKok avatar TiesdeKok commented on August 17, 2024

You think I would suggest a fix without testing it? 😜
I copy pasted the code that worked for me into my comment. (Maybe something went wrong there?)

It could be that they changed something in a dynamic way, that would explain why my fix works for me but not for you.

If you follow these steps you might be able to figure out the problem:

  1. Go to: https://accounts.google.com/ServiceLoginBoxAuth
  2. View source and search for GALX
  3. The regular expression of line 64 should capture the GALX value after the value argument

In my case the problem was that the order of the arguments changed to type before name

from pytrends.

patrick-ogrady avatar patrick-ogrady commented on August 17, 2024

haha you can see the frustration boiling over;) Sorry about that...let me check it out. Thanks!

from pytrends.

patrick-ogrady avatar patrick-ogrady commented on August 17, 2024

Works perfectly!

from pytrends.

dreyco676 avatar dreyco676 commented on August 17, 2024

Is there a fix that should get pull request?

On Wed, Dec 9, 2015 at 12:41 PM, patrick-ogrady [email protected]
wrote:

Works perfectly!


Reply to this email directly or view it on GitHub
#25 (comment).

from pytrends.

patrick-ogrady avatar patrick-ogrady commented on August 17, 2024

We both encountered an issue with login and the above fix remedied it very
nicely! I recommend following the advice above of replacing line 64 with
64-67!

On Wednesday, December 9, 2015, John Hogue [email protected] wrote:

Is there a fix that should get pull request?

On Wed, Dec 9, 2015 at 12:41 PM, patrick-ogrady <[email protected]
javascript:_e(%7B%7D,'cvml','[email protected]');>
wrote:

Works perfectly!


Reply to this email directly or view it on GitHub
<#25 (comment)
.


Reply to this email directly or view it on GitHub
#25 (comment).

from pytrends.

TiesdeKok avatar TiesdeKok commented on August 17, 2024

I can send you a pull request tomorrow morning if you want.

Update:
See #26 for the pull request with my fix.

from pytrends.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.