Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
update_cate
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
02b82e44
authored
Apr 10, 2019
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add proxy
parent
44fc82f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletions
plat/element14/cate_stock.py
plat/element14/cate_stock.py
View file @
02b82e44
...
...
@@ -16,8 +16,26 @@ headers = {
"upgrade-insecure-requests"
:
"1"
,
"user-agent"
:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"
,
}
#http代理接入服务器地址端口
proxyHost
=
"http-proxy-t3.dobel.cn"
proxyPort
=
"9180"
resp
=
a
.
requests
.
session
()
.
get
(
url
,
headers
=
headers
)
.
text
#账号密码
proxyUser
=
"LIEXINHTT1"
proxyPass
=
"oK97IIl298"
proxyMeta
=
"http://
%(user)
s:
%(pass)
s@
%(host)
s:
%(port)
s"
%
{
"host"
:
proxyHost
,
"port"
:
proxyPort
,
"user"
:
proxyUser
,
"pass"
:
proxyPass
,
}
proxies
=
{
"http"
:
proxyMeta
,
"https"
:
proxyMeta
,
}
resp
=
a
.
requests
.
get
(
url
,
headers
=
headers
,
proxies
=
proxies
)
.
text
doms
=
a
.
etree
.
HTML
(
resp
)
cate_pagecount_pattern
=
a
.
re
.
compile
(
''
)
content_sections
=
doms
.
xpath
(
'//div[@class="categoryContainer"]//section'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment