Skip to content

Commit

Permalink
Add logo
Browse files Browse the repository at this point in the history
  • Loading branch information
howie6879 committed Feb 14, 2019
1 parent e7cbd43 commit 8647198
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -177,7 +177,7 @@ JavaScript Support
~~~~~~~~~~~~~~~~~~

You can load js by using
`ruia-pyppeteer <https://github.com/ruia-plugins/ruia-pyppeteer>`__.
`ruia-pyppeteer <https://github.com/python-ruia/ruia-pyppeteer>`__.

For example:

Expand All @@ -187,7 +187,7 @@ For example:
from ruia_pyppeteer import PyppeteerRequest as Request
request = Request("https://www.jianshu.com/", load_js=True)
request = Request("https://www.jianshu.com/")
response = asyncio.run(request.fetch()) # Python 3.7
print(response.html)
Expand Down
Binary file added docs/images/favicon.ico
Binary file not shown.
Binary file added docs/images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/index.md
Expand Up @@ -158,7 +158,7 @@ More details click [here](https://github.com/howie6879/ruia/blob/master/examples

### JavaScript Support

You can load js by using [ruia-pyppeteer](https://github.com/ruia-plugins/ruia-pyppeteer).
You can load js by using [ruia-pyppeteer](https://github.com/python-ruia/ruia-pyppeteer).

For example:

Expand All @@ -167,7 +167,7 @@ import asyncio

from ruia_pyppeteer import PyppeteerRequest as Request

request = Request("https://www.jianshu.com/", load_js=True)
request = Request("https://www.jianshu.com/")
response = asyncio.run(request.fetch()) # Python 3.7
print(response.html)
```
Expand Down
11 changes: 2 additions & 9 deletions examples/topics_examples/js_demo.py
@@ -1,12 +1,10 @@
#!/usr/bin/env python
"""
pip install ruia_pyppeteer
pip install -U ruia_pyppeteer
"""

from ruia import AttrField, TextField, Item

from ruia_pyppeteer import PyppeteerSpider as Spider
from ruia_pyppeteer import PyppeteerRequest as Request


class JianshuItem(Item):
Expand All @@ -21,16 +19,11 @@ async def clean_author_url(self, author_url):
class JianshuSpider(Spider):
start_urls = ['https://www.jianshu.com/']
concurrency = 10
# Load js on the first request
load_js = True

async def parse(self, response):
async for item in JianshuItem.get_items(html=response.html):
# Loading js by using PyppeteerRequest
yield Request(url=item.author_url, load_js=self.load_js, callback=self.parse_item)

async def parse_item(self, response):
print(response)
print(item)


if __name__ == '__main__':
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Expand Up @@ -10,6 +10,8 @@ copyright: Copyright &copy; 2018 - 2019 <a href="https://github.com/howie6879/ru

theme:
name: 'material'
logo: './images/logo.png'
favicon: './images/favicon.ico'

use_directory_urls: false

Expand Down
2 changes: 1 addition & 1 deletion ruia/__init__.py
Expand Up @@ -7,4 +7,4 @@
from .response import Response
from .spider import Spider

__version__ = '0.4.9'
__version__ = '0.5.0'

0 comments on commit 8647198

Please sign in to comment.