Toggle navigation
Toggle navigation
This project
Loading...
Sign in
LiuFuhua
/
xj-marketing
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
rinalLi
2024-12-24 11:34:53 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f1cafc4d2a28988f9575b102ec0f1114eab06fea
f1cafc4d
1 parent
74e2d5d1
u
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
3 deletions
uploader/xhs_uploader/main.py
uploader/xhs_uploader/main.py
View file @
f1cafc4
...
...
@@ -25,7 +25,6 @@ async def read_cookies_from_file(file_path):
return
[]
async
def
cookie_auth
(
account_file
):
print
(
account_file
)
async
with
async_playwright
()
as
playwright
:
browser
=
await
playwright
.
chromium
.
launch
(
headless
=
True
)
# context = await browser.new_context(storage_state=account_file)
...
...
@@ -35,7 +34,6 @@ async def cookie_auth(account_file):
await
context
.
add_cookies
(
saved_cookies
)
await
page
.
goto
(
"https://www.xiaohongshu.com"
)
try
:
print
(
await
page
.
title
())
await
page
.
wait_for_selector
(
"div.link-wrapper a.link-wrapper span.channel"
,
timeout
=
5000
)
# 等待5秒
xhs_logger
.
success
(
"[+] cookie 有效"
)
return
True
...
...
@@ -128,7 +126,7 @@ class XHSVideo(object):
xhs_logger
.
info
(
"正在填充标题和话题..."
)
await
page
.
locator
(
"div.titleInput div div input"
)
.
fill
(
"花花"
)
await
page
.
locator
(
"div.titleInput div div input"
)
.
fill
(
self
.
title
)
inputTag
=
page
.
locator
(
'id=quillEditor'
)
.
locator
(
'div p'
)
await
inputTag
.
click
()
...
...
Please
register
or
login
to post a comment