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

Can't run the program #2

Closed
Purefreeman opened this issue Apr 15, 2018 · 5 comments
Closed

Can't run the program #2

Purefreeman opened this issue Apr 15, 2018 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Purefreeman
Copy link

The program doesn't seem to work, and i'm not sure what the possible cause is...

C:\Users\dolap_000\Desktop\media-scraper-master>python -m mediascraper.twitter [3347813921]
Starting PhantomJS web driver...
C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\phantomjs\webdriver.py:49: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead
warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '
Logging in as "Dolapofreeman"...
Traceback (most recent call last):
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\dolap_000\Desktop\media-scraper-master\mediascraper\twitter.py", line 14, in
scraper.login('credentials.json')
File "C:\Users\dolap_000\Desktop\media-scraper-master\mediascrapers.py", line 410, in login
username.send_keys(credentials['username'])
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute
return self._parent.execute(command, params)
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 237, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidElementStateException: Message: {"errorMessage":"Element is not currently interactable and may not be manipulated","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"182","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:62282","User-Agent":"Python http auth"},"httpVersion":"1.1","method":"POST","post":"{"text": "Dolapofreeman", "value": ["D", "o", "l", "a", "p", "o", "f", "r", "e", "e", "m", "a", "n"], "id": ":wdc:1523809525391", "sessionId": "96a881f0-40c9-11e8-a71a-c10ae27e62ae"}","url":"/value","urlParsed":{"anchor":"","query":"","file":"value","directory":"/","path":"/value","relative":"/value","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/value","queryKey":{},"chunks":["value"]},"urlOriginal":"/session/96a881f0-40c9-11e8-a71a-c10ae27e62ae/element/:wdc:1523809525391/value"}}
Screenshot: available via screen

@Purefreeman
Copy link
Author

still can't use it

@elvisyjlin
Copy link
Owner

elvisyjlin commented May 31, 2018

Hi @Purefreeman,

Thank you for using my tool!

I found a little bug and fixed it for the error you found.

However, I'm not sure which account you would like to scrape. For a Twitter account, the arguments are supposed to be usernames (without brackets []). And 3347813921 does not seem to be a user name.

For example, to scrape the account Twitter (https://twitter.com/Twitter)

python3 -m mediascraper.twitter Twitter

Please pull this repo for updates and test media-scraper with this command. Thanks!

@elvisyjlin elvisyjlin self-assigned this May 31, 2018
@elvisyjlin elvisyjlin added the bug Something isn't working label May 31, 2018
@Purefreeman
Copy link
Author

Thank you, but unfortunately i am still getting the same error

python -m mediascraper.twitter purefreeman
Starting PhantomJS web driver...
Web driver ".\webdriver/phantomjsdriver_2.1.1_win32/phantomjs.exe" not found.
Start downloading the web driver...
Web driver ".\webdriver/phantomjsdriver_2.1.1_win32/phantomjs.exe" has been downloaded successfully.
C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\phantomjs\webdriver.py:49: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead
warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '
Logging in as "Kheshig"...
Traceback (most recent call last):
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\dolap_000\Desktop\media-scraper-master\mediascraper\twitter.py", line 14, in
scraper.login('credentials.json')
File "C:\Users\dolap_000\Desktop\media-scraper-master\mediascrapers.py", line 415, in login
username.send_keys(credentials['username'])
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute
return self._parent.execute(command, params)
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "C:\Users\dolap_000\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 237, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidElementStateException: Message: {"errorMessage":"Element is not currently interactable and may not be manipulated","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"146","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:53380","User-Agent":"Python http auth"},"httpVersion":"1.1","method":"POST","post":"{"text": "Kheshig", "value": ["K", "h", "e", "s", "h", "i", "g"], "id": ":wdc:1527762097196", "sessionId": "62fe91c0-64bc-11e8-a9aa-83661e939ba1"}","url":"/value","urlParsed":{"anchor":"","query":"","file":"value","directory":"/","path":"/value","relative":"/value","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/value","queryKey":{},"chunks":["value"]},"urlOriginal":"/session/62fe91c0-64bc-11e8-a9aa-83661e939ba1/element/:wdc:1527762097196/value"}}
Screenshot: available via screen

@elvisyjlin
Copy link
Owner

I'm sorry for the login error in Twitter. That was another bug.

The reason of this exception is that Twitter places 3 forms in the login page. 2 of them, however, are not able to input values. I've update the login function to locate to correct form and test it by logging in my personal account.

Please test it again, @Purefreeman . Thank you for your patience.

@Purefreeman
Copy link
Author

No, thank you so much. Thank you for this wonderful tool. it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants