Python askfm crawler.
Project description
# askfmcrawler
[![PyPI Version](https://img.shields.io/pypi/v/askfmcrawler.svg)](https://pypi.python.org/pypi/askfmcrawler)
Python askfm crawler.
## Install
```
pipenv install askfmcrawler
```
## Requirements
- Python 3.6 or higher
- selenium
## Usage
```python
from selenium import webdriver
from askfmcrawler import Crawler
driver = webdriver.Chrome('./chromedriver')
crawler = Crawler(driver)
# Crawl user questions
for article in crawler.crawl_user_questions('uehara1414test', limit=20):
print(article.question, " => ", article.answer)
# 好きなデザートは? => ガトーショコラ
# 赤信号なのに道路を渡ることはある? => ある
# ...
# Get random users and crawl questions of them
for user in crawler.crawl_random_users():
for article in crawler.crawl_user_questions(user):
print(user, article.question, " => ", article.answer)
```
## Test
### Setup
- Install requiremnts with `pipenv install --dev`
- Place chromedriver to project root
### Run tests
```sh
pipenv run nosetests
```
[![PyPI Version](https://img.shields.io/pypi/v/askfmcrawler.svg)](https://pypi.python.org/pypi/askfmcrawler)
Python askfm crawler.
## Install
```
pipenv install askfmcrawler
```
## Requirements
- Python 3.6 or higher
- selenium
## Usage
```python
from selenium import webdriver
from askfmcrawler import Crawler
driver = webdriver.Chrome('./chromedriver')
crawler = Crawler(driver)
# Crawl user questions
for article in crawler.crawl_user_questions('uehara1414test', limit=20):
print(article.question, " => ", article.answer)
# 好きなデザートは? => ガトーショコラ
# 赤信号なのに道路を渡ることはある? => ある
# ...
# Get random users and crawl questions of them
for user in crawler.crawl_random_users():
for article in crawler.crawl_user_questions(user):
print(user, article.question, " => ", article.answer)
```
## Test
### Setup
- Install requiremnts with `pipenv install --dev`
- Place chromedriver to project root
### Run tests
```sh
pipenv run nosetests
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
askfmcrawler-0.1.3.tar.gz
(2.3 kB
view details)
File details
Details for the file askfmcrawler-0.1.3.tar.gz
.
File metadata
- Download URL: askfmcrawler-0.1.3.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d6d667451f0baeb75c2dd910875b26c282237b8940c33ceedb275e04dc5354f |
|
MD5 | 188eee83d5481cad3d21005652e4e8b1 |
|
BLAKE2b-256 | cf86bf0978b55e9a46d2532bd5bcaeec08157c8cc445a922a5aa3a0c408ccba9 |