Comments (5)
Similar for python 3.5:
python sciencenet_spider.py
[2018:04:14 22:32:58] Spider started!
[2018:04:14 22:32:58] Using selector: KqueueSelector
[2018:04:14 22:32:58] Base url: http://blog.sciencenet.cn/
[2018:04:14 22:32:58] Item "Post": 0
[2018:04:14 22:32:58] Requests count: 0
[2018:04:14 22:32:58] Error count: 0
[2018:04:14 22:32:58] Time usage: 0:00:00.001171
[2018:04:14 22:32:58] Spider finished!
Traceback (most recent call last):
File "sciencenet_spider.py", line 19, in <module>
MySpider.run()
File "/Users/endafarrell/anaconda/anaconda3/envs/py35/lib/python3.5/site-packages/gain/spider.py", line 52, in run
loop.run_until_complete(cls.init_parse(semaphore))
File "/Users/endafarrell/anaconda/anaconda3/envs/py35/lib/python3.5/asyncio/base_events.py", line 467, in run_until_complete
return future.result()
File "/Users/endafarrell/anaconda/anaconda3/envs/py35/lib/python3.5/asyncio/futures.py", line 294, in result
raise self._exception
File "/Users/endafarrell/anaconda/anaconda3/envs/py35/lib/python3.5/asyncio/tasks.py", line 240, in _step
result = coro.send(None)
File "/Users/endafarrell/anaconda/anaconda3/envs/py35/lib/python3.5/site-packages/gain/spider.py", line 71, in init_parse
with aiohttp.ClientSession() as session:
File "/Users/endafarrell/anaconda/anaconda3/envs/py35/lib/python3.5/site-packages/aiohttp/client.py", line 746, in __enter__
raise TypeError("Use async with instead")
TypeError: Use async with instead
sys:1: RuntimeWarning: coroutine 'Parser.task' was never awaited
[2018:04:14 22:32:58] Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x107259e48>
When python is:
python
Python 3.5.5 |Anaconda, Inc.| (default, Mar 12 2018, 16:25:05)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
from gain.
Check this line 2c8160c#diff-6b9bdc895398e257e454fa60948dba08R69
Just clone the latest code...
It seems that author didn't release the latest version to pypi @gaojiuli
from gain.
Hi @solarhell - many thanks. After I clone'd the latest code (and then added my local-subdir gain
to the sys.path), the example works.
@gaojiuli - I'd love to know when pypi is updated!
from gain.
same issue in python3.6
[2019:01:30 10:04:19] Spider started!
[2019:01:30 10:04:19] Base url: http://blog.sciencenet.cn/
[2019:01:30 10:04:19] Item "Post": 0
[2019:01:30 10:04:19] Requests count: 0
[2019:01:30 10:04:19] Error count: 0
[2019:01:30 10:04:19] Time usage: 0:00:00.000988
[2019:01:30 10:04:19] Spider finished!
Traceback (most recent call last):
File "sciencenet_spider.py", line 19, in
MySpider.run()
File "/Users/leichen/anaconda3/lib/python3.6/site-packages/gain/spider.py", line 52, in run
loop.run_until_complete(cls.init_parse(semaphore))
File "uvloop/loop.pyx", line 1451, in uvloop.loop.Loop.run_until_complete
File "/Users/leichen/anaconda3/lib/python3.6/site-packages/gain/spider.py", line 71, in init_parse
with aiohttp.ClientSession() as session:
File "/Users/leichen/anaconda3/lib/python3.6/site-packages/aiohttp/client.py", line 956, in enter
raise TypeError("Use async with instead")
TypeError: Use async with instead
[2019:01:30 10:04:19] Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x111d2e940>
sys:1: RuntimeWarning: coroutine 'Parser.task' was never awaited
OS: Mac Darwin Kernel Version 18.2.0
Python Python 3.6.3 :: Anaconda custom (64-bit)
install gain via pip install gain
AnyIdea ?
from gain.
Just install it via pip install -U -e git+https://github.com/gaojiuli/gain.git#egg=gain
from gain.
Related Issues (20)
- Test failed on Windows HOT 1
- Please do a decent code review before accepting pull requests HOT 1
- Css selector add attr not work correctly HOT 1
- TypeError: write() argument must be str, not dict HOT 1
- Limit the interval between two requests. HOT 7
- Add PhantomJS support. HOT 1
- add encoding HOT 1
- Add document's own parsing HOT 1
- add cssParser
- Repeated bug
- aiofiles BUG HOT 1
- Does it work on OSX? HOT 1
- Add hooks before download and after download. HOT 3
- What does this statement mean? HOT 1
- Gain Improvements - Ludaro HOT 5
- SSL handshake failed on verifying the certificate HOT 1
- bug
- demo error
- The project is dead
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 gain.