Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
network-assets-reptile
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
network-assets-reptile
Commits
37ffd734
Commit
37ffd734
authored
Jul 26, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:ins爬取数据img标签增加style属性
parent
1d39268a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
pc_instagram.py
pc_instagram.py
+2
-0
No files found.
pc_instagram.py
View file @
37ffd734
...
@@ -101,6 +101,7 @@ def reptile(browser=None, search_word=""):
...
@@ -101,6 +101,7 @@ def reptile(browser=None, search_word=""):
title
=
""
title
=
""
img_soup
=
BeautifulSoup
(
item
.
get_attribute
(
"outerHTML"
),
"html.parser"
)
.
find
(
"img"
)
img_soup
=
BeautifulSoup
(
item
.
get_attribute
(
"outerHTML"
),
"html.parser"
)
.
find
(
"img"
)
del
img_soup
[
"srcset"
]
del
img_soup
[
"srcset"
]
img_soup
[
"style"
]
=
"width:100
%
"
src
=
item
.
get_attribute
(
"src"
)
src
=
item
.
get_attribute
(
"src"
)
else
:
else
:
# 有视频,图片链接从列表中提取
# 有视频,图片链接从列表中提取
...
@@ -108,6 +109,7 @@ def reptile(browser=None, search_word=""):
...
@@ -108,6 +109,7 @@ def reptile(browser=None, search_word=""):
a_soup
=
BeautifulSoup
(
element_link_list
[
index
]
.
get_attribute
(
"outerHTML"
),
"html.parser"
)
a_soup
=
BeautifulSoup
(
element_link_list
[
index
]
.
get_attribute
(
"outerHTML"
),
"html.parser"
)
# img_element = element_link_list[index].find_element("xpath","img")
# img_element = element_link_list[index].find_element("xpath","img")
img_soup
=
a_soup
.
find
(
"img"
)
img_soup
=
a_soup
.
find
(
"img"
)
img_soup
[
"style"
]
=
"width:100
%
"
src
=
img_soup
[
"src"
]
src
=
img_soup
[
"src"
]
str_list
=
link_str
.
split
(
"/"
)
str_list
=
link_str
.
split
(
"/"
)
img_id
=
str_list
[
len
(
str_list
)
-
2
]
img_id
=
str_list
[
len
(
str_list
)
-
2
]
...
...
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