-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from JJ/master
Some changes in docs and file name
- Loading branch information
Showing
7 changed files
with
56 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tropescraper.egg-info/ | ||
__pycache__ | ||
scraper_cache/ | ||
*~ | ||
.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
dist: xenial | ||
language: python | ||
python: | ||
- "3.6" | ||
- "3.7" | ||
- "3.6-dev" # 3.6 development branch | ||
- "3.7-dev" # 3.7 development branch | ||
install: | ||
- pip install -e . | ||
script: pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,20 @@ | ||
# tropescraper | ||
A tropes scraper | ||
|
||
A scraper for the website TV tropes. | ||
|
||
|
||
## Install | ||
|
||
Install all dependencies with: | ||
|
||
pip install -e . | ||
|
||
(pip should be installed and available). | ||
|
||
## Run | ||
|
||
Run it with | ||
|
||
bin/scrape-tvtropes | ||
|
||
It will take a good while while it scrapes ~12k films. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import unittest | ||
from tropescraper.web_page_retriever import WebPageRetriever | ||
|
||
class TestWebPageRetriever(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.scraper = WebPageRetriever(0.5,"https://tvtropes.org/pmwiki/pmwiki.php/Film/FantasticBeastsAndWhereToFindThem","/tmp") | ||
|
||
def test_class(self): | ||
self.assertIsInstance( self.scraper, WebPageRetriever, "Correct class" ) | ||
|
||
def test_retrieve(self): | ||
content = self.scraper.retrieve() | ||
self.assertNotEqual( content, "", "Retrieves something") | ||
content2 = self.scraper.retrieve() | ||
self.assertEqual( content, content2, "Retrieves from cache") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters