Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 1 #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bustag/spider/bus_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .db import save, Item
from bustag.util import APP_CONFIG, get_full_url, logger
router = get_router()
MAXPAGE = 30
MAXPAGE = 300


def get_url_by_fanhao(fanhao):
Expand Down
9 changes: 8 additions & 1 deletion bustag/spider/parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'''
html parser to extract data
'''
import sys
import re
from collections import namedtuple
from requests_html import HTML
Expand All @@ -25,7 +26,13 @@ def parse_item(text):
title_css = 'body > div.container > h3'
title = html.find(title_css)[0].text
cover_img_css = 'body > div.container > div.row.movie > div.col-md-9.screencap > a'
cover_img_url = "http://www.javbus.com" + html.find(cover_img_css)[0].attrs['href']
a = "http://www.javbus.com"
b = html.find(cover_img_css)[0].attrs['href']
if re.match(r'^https?:/{2}\w.+$', b):
cover_img_url = b
else:
cover_img_url = a + b
#cover_img_url = "http://www.javbus.com" + html.find(cover_img_css)[0].attrs['href']
tags_css = 'body > div.container > div.row.movie > div.col-md-3.info'
tags = html.find(tags_css)[0].find('p')
release_date = tags[1].text
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ wrapt==1.11.2
yarg==0.1.9
yarl==1.3.0
zipp==0.5.2
-e git+https://github.com/dockerfile-test/bustag.git#egg=bustag
-e git+https://github.com/dockerfile-test/bustag.git@dev#egg=bustag