Comments (17)
Your script runs fine for me!
import requests_html
with requests_html.HTMLSession() as session:
r = session.get('https://www.gdax.com/trade/LTC-EUR')
r.html.render()
print(r.html.find('.MarketInfo_market-num_1lAXs', first=True).text)
Result:
169.00 EUR
Slightly modified. Pyppeteer might not work on Windows. I'll have to test.
from requests-html.
Oh, make sure you're using python 3.6!
from requests-html.
Here is the full traceback, sir. Link to the traceback "https://www.dropbox.com/s/40ohohrte9keplo/traceback.txt?dl=0". I know it's hard to give any solution hypothetically. However, if I get any clue why I'm facing such error then I might take any initiative to resolve that. I've already created a thread in StackOverflow to get any solution for but it seems you have released it very lately that is why few peoples are aware of it.
from requests-html.
Well pyppeteer requires python 3.6.
from requests-html.
Thanks for the quick turnaround, sir. I'm gonna upgrade the version. It was an immense pleasure to have any solution from the author himself. I may get back if I face any issue after running the script when my version is update. Thanks sir.
from requests-html.
I'm testing on Windows as we speak.
from requests-html.
Windows works great! You just have to use Python 3.6.
from requests-html.
(You're using Python 3.5)
from requests-html.
It's a revolutionary attempt. This library will make a new era undoubtedly.
from requests-html.
Awe, thank you :)
Do give Python 3.6 a try βΒ it should "just work".
from requests-html.
Hi again, sir!! I've already upgraded my Python version to 3.6.4. I'm on windows 7, 32 bit. When I execute the above script, I get a different traceback now. Here goes the full error. Thanks in advance, sir.
Exception in callback NavigatorWatcher.waitForNavigation.<locals>.watchdog_cb(<Task finishe...> result=None>) at C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyppeteer\navigator_watcher.py:49
handle: <Handle NavigatorWatcher.waitForNavigation.<locals>.watchdog_cb(<Task finishe...> result=None>) at C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyppeteer\navigator_watcher.py:49>
Traceback (most recent call last):
File "C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run
self._callback(*self._args)
File "C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyppeteer\navigator_watcher.py", line 52, in watchdog_cb
self._timeout)
File "C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyppeteer\navigator_watcher.py", line 40, in _raise_error
raise error
concurrent.futures._base.TimeoutError: Navigation Timeout Exceeded: 3000 ms exceeded
Traceback (most recent call last):
File "C:\Users\ar\AppData\Local\Programs\Python\Python36-32\demo.py", line 13, in <module>
item = js.find('.MarketInfo_market-num_1lAXs',first=True).text
AttributeError: 'NoneType' object has no attribute 'find'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\shutil.py", line 387, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\ar\\.pyppeteer\\.dev_profile\\tmp2hnn897d\\CrashpadMetrics-active.pma'
from requests-html.
you might want to run it in an administrator mode cmd.exe
from requests-html.
I've tried that as well, sir. Having the same error.
from requests-html.
try removing ~/.pyppeteer
from requests-html.
not sure what's wrong! no issues here.
from requests-html.
I did a slight modification in my script to fetch the data. Now, I can get the desired content. However, along with the data I'm getting several errors. Take a look below. I have already marked the result with a marker. How can I kick out errors?
Modified script:
import requests_html
with requests_html.HTMLSession() as session:
r = session.get('https://www.gdax.com/trade/LTC-EUR')
r.html.render(sleep=10)
item = r.html.find("[class^='MarketInfo_market-num_']",first=True).text
print(item)
Error along with result (take a look at the long dot which indicates the value) :
Exception in callback NavigatorWatcher.waitForNavigation.<locals>.watchdog_cb(<Task finishe...> result=None>) at C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyppeteer\navigator_watcher.py:49
handle: <Handle NavigatorWatcher.waitForNavigation.<locals>.watchdog_cb(<Task finishe...> result=None>) at C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyppeteer\navigator_watcher.py:49>
Traceback (most recent call last):
File "C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run
self._callback(*self._args)
File "C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyppeteer\navigator_watcher.py", line 52, in watchdog_cb
self._timeout)
File "C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyppeteer\navigator_watcher.py", line 40, in _raise_error
raise error
concurrent.futures._base.TimeoutError: Navigation Timeout Exceeded: 3000 ms exceeded
167.69 EUR ====================================================
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Users\ar\AppData\Local\Programs\Python\Python36-32\lib\shutil.py", line 387, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\ar\\.pyppeteer\\.dev_profile\\tmp4m18xik8\\CrashpadMetrics-active.pma'
from requests-html.
Except for parsing javascript content, the library is awesome when it comes to play with css selector or xpath. It even supports pseudo selectors that BeautifulSoup could not. lxml library supports pseudo selectors, though.
from requests-html.
Related Issues (20)
- Not all text matched with link nested in spans HOT 1
- PYPI package HOT 8
- poetry refactoring HOT 4
- RuntimeError: Event loop is closed when running all the tests.
- Suggest documenting x11 and other libs must be present
- UnicodeEncodeError: 'utf-8' codec can't encode character '\uddf1' in position 5584: surrogates not allowed
- A Browser closed issue HOT 3
- change bs4 dependency to beautifulsoup
- Browser closed unexpectedly HOT 2
- "Your browser is outdated" error HOT 3
- running render in Termux
- Type annotations
- Consider switching from lxml's clean_html for enhanced security (and possibly performance) HOT 1
- Get all html error
- hover on "read more"
- orange marker in the header
- playwright page.on("response", handler) HOT 1
- Not support get text in Element within other element'text of Element (innerText)
- find() got always None on JS rendered website
- How to select element in drop-down list
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from requests-html.