-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
[FIX] 26.11.2024: fix xpathes because uploading videos failed. #177
base: main
Are you sure you want to change the base?
Conversation
src/tiktok_uploader/upload.py
Outdated
tmp = "/html/body/div[1]/div/div[2]/div[2]/div/div/div/div/div[3]/div/div[2]/div[10]/button[1]" | ||
post = WebDriverWait(driver, config["implicit_wait"]).until( | ||
EC.element_to_be_clickable( | ||
(By.XPATH, config["selectors"]["upload"]["post"]) | ||
(By.XPATH, tmp) # config["selectors"]["upload"]["post"] was instead of tmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should change value in config file instead of tmp
variable and use this value //button[@data-e2e="post_video_button"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lavanphat fixed
src/tiktok_uploader/upload.py
Outdated
tmp1 = "/html/body/div[6]/div/div/div[3]/button[2]" | ||
post_confirmation = EC.presence_of_element_located( | ||
(By.XPATH, config["selectors"]["upload"]["post_confirmation"]) | ||
(By.XPATH, tmp1) # config["selectors"]["upload"]["post_confirmation"] was instead of tmp1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same above comment, you should change value in config file instead of tmp
variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lavanphat fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -55,8 +55,8 @@ user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTM | |||
duet = "//label[.='Duet']/following-sibling::div/input" | |||
stitch = "//label[.='Stitch']/following-sibling::div/input" | |||
|
|||
post = "//button[contains(@class, 'TUXButton--primary')]" | |||
post_confirmation = "//div[contains(text(), 'Your video has been uploaded')]" | |||
post = "//*[@id=\"root\"]/div/div[2]/div[2]/div/div/div/div/div[3]/div/div[2]/div[10]/button[1]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too fragile of an xpath
Did you build and test these changes locally? What did you do to know that it looks good to you? |
I had troubles in uploading new videos, so i debugged the library and changed 2 xpathes because they were wrong. I suppose they are outdated. Also i commented 2 lines of code, which failed.
I did not dive deep in the logic and just made fixes so it works.