-
Notifications
You must be signed in to change notification settings - Fork 24
/
setup.py
executable file
·40 lines (34 loc) · 909 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# coding=utf-8
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='jparser',
author="Sun, Junyi",
version='0.0.20',
license='MIT',
packages=["jparser"],
description="A robust parser which can extract title, content, images from html pages",
long_description='''
Usage Example:
^^^^^^^^^^^^^^^^^^^^^
::
import urllib2
from jparser import PageModel
html = urllib2.urlopen("http://news.sohu.com/20170512/n492734045.shtml").read().decode('gb18030')
pm = PageModel(html)
result = pm.extract()
print "==title=="
print result['title']
print "==content=="
for x in result['content']:
if x['type'] == 'text':
print x['data']
if x['type'] == 'image':
print "[IMAGE]", x['data']['src']
''',
install_requires=[
"lxml >= 3.7.1",
]
)