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

After switching chanel stuck at finding "selectBtn" because drop-down menu lack, #118

Merged
merged 5 commits into from
Jul 2, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ async function uploadVideo(videoJSON: Video) {
const closeBtnXPath = "//*[normalize-space(text())='Close']"
const selectBtnXPath = "//*[normalize-space(text())='Select files']"
const saveCloseBtnXPath = '//*[@aria-label="Save and close"]/tp-yt-iron-icon'
const createBtnXPath = '//*[@id="create-icon"]/tp-yt-iron-icon'
const addVideoBtnXPath = '//*[@id="text-item-0"]/ytcp-ve/div/div/yt-formatted-string'
if(page.waitForXPath(createBtnXPath)){
const createBtn = page.$x(createBtnXPath);
createBtn[0].click();
}
if(page.waitForXPath(addVideoBtnXPath)){
const addVideoBtn =page.$x(addVideoBtnXPath);
addVideoBtn[0].click();
}
for (let i = 0; i < 2; i++) {
try {
await page.waitForXPath(selectBtnXPath)
Expand Down