YT Button

marcos16

New Member
VIP
Joined
Nov 30, 2020
Messages
2
Reaction score
0
Achievement
Hello, I need help about that two buttons in youtube: ''No thanks'' and ''I agree''
Captura de pantalla 2020-12-13 221046.pngCaptura de pantalla 2020-12-13 221056.png
For the first one I have this code:

await ClickByClass("style-scope yt-button-renderer style-text size-small");

But for the second one I don't know what to write, because class and id doesn't work for me. Could someone give me a hand? Thanks in advance.
 

opsfafsme

Well-Known Member
Rule The Universe
VIP
Joined
Jul 2, 2018
Messages
243
Reaction score
91
Website
OnlinePiercingShop.com
Achievement
await ClickByXpath (xpath, nClick, frameUrlRegex)

Click on an element based on its xpath.

Parameters:
  • xpath: xpath of the element. You may use the GenerateXpath function to generate xpath.
  • nClick: number of clicks, the default is 1.
  • frameUrlRegex: The regex pattern of the frame URL to click on, the default is the main frame.
Example: await ClickByXpath("/html/body/div/div[1]/div/ul/li[6]/a/div[1]/span");
await ClickByXpath(GenerateXpath("a", "href", "https://9hits.com%"));

 
  • Like
Reactions: marcos16

marcos16

New Member
VIP
Joined
Nov 30, 2020
Messages
2
Reaction score
0
Achievement
Thanks for your quick response. I tried used xpath too but it isn't working. This is the code I'm using for the ''I agree'' button:

await ClickByXpath("/html/body/div/c-wiz/div[2]/div/div/div/div/div[2]/form/div/span/span");

However, the xpath code for the ''No thanks'' button works flawlessly:

await ClickByXpath("/html/body/ytd-app/ytd-popup-container/paper-dialog/yt-upsell-dialog-renderer/div/div[3]/div[1]/yt-button-renderer/a/paper-button/yt-formatted-string");

So I don't really know where's the problem, I don't know what I'm doing wrong.
 

Younghusband

New Member
Premium
Joined
Dec 10, 2020
Messages
1
Reaction score
0
Achievement
I can't solve the problem, is it possible to get a more detailed solution please?
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu