css-selectors

How to click a link within youtube comment using python selenium

六眼飞鱼酱① 提交于 2021-02-04 08:26:31
问题 I'm new to selenium python, I'm trying to click a link in the youtube comment but I don't know what element to use? Can someone help me? thanks . example : <a class="yt-simple-endpoint style-scope yt-formatted-string" spellcheck="false" href="/redirect?event=comments&redir_token=ttzJJRuKzz6sJPh8qdMnWStc-958MTU0NjE1NDU4M0AxNTQ2MDY4MTgz&stzid=Ugw6ip_QkzwyJPIq3bp4AaABAg&q=https%3A%2F%2Fjulissars.itworks.com%2F" rel="nofollow">https://julissars.itworks.com</a> link 回答1: To click on the desired

How to wait until all loaders disappears using Selenium WebDriver through Java

旧巷老猫 提交于 2021-02-04 08:18:22
问题 I am using selenium web driver and I need to wait until all loaders disappear. I have 12 widgets on dashboard page and I need to wait until all widgets are loaded. Loader shows on each widget. I have used both following ways but nothing works and no errors, it just passes on to next statement. new WebDriverWait(driver,60) .until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//div[contains(text(),'Loader')]"))); WebDriverWait wait2 = new WebDriverWait(driver,60); wait2.until

How to click a dynamic link with in a drupal 8 website using xpath/css selector while automating through Selenium and Python

三世轮回 提交于 2021-02-04 08:12:12
问题 I am trying to click on an edit tab link, and its in the form of a hyperlink in an unordered list. Here is the HTML: <li><a href="/node/2658/edit" data-drupal-link-system-path="node/2658/edit">Edit</a></li> I have been trying to use driver.find_element_by_link_text('Edit') to find the element, however always get a NoSuchElementException . I have also used the by partial text fxn, with all variations of the html, and receive the same error. There is also the following html I found that

How to click within the username field within ProtonMail signup page using Selenium and Java

筅森魡賤 提交于 2021-02-04 08:08:40
问题 I'm not able to make it Wright in an username at https://mail.protonmail.com/create/new?language=en. For some reason it cant find or cant klick at "choose username", Can any one help me out? Code trials: public class LaunchApplication { public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver", "C:\\chromedriver_win32\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.manage().window().maximize(); int number = 1; String

Getting specific elements in selenium

二次信任 提交于 2021-02-04 08:01:33
问题 I am trying to get the elements displayed as N06D-X N07X R01A-C01 S01G-X01 in the following image: Now, I got something like the WebDriver in this way: who = driver.find_element_by_tag_name("span").find_elements_by_tag_name("p") and get an output like this: [<selenium.webdriver.remote.webelement.WebElement (session="1c044455cf883fdedf6845bcd456bfab", element="0.23338884730774767-2")>] I am working on Mac Catalina and when I type: who.text it returns an empty list for some reason. I got quite

Python Selenium cant find the Add photo and video button element on Facebook

拈花ヽ惹草 提交于 2021-02-02 09:55:13
问题 Im trying to upload an image to facebook and im unable to click on the Add photo and video button. When im looking at the html this is the element im trying to click: <input aria-label="Add Photo or Video" accept="video/*, video/x-m4v, video/webm, video/x-ms-wmv, video/x-msvideo, video/3gpp, video/flv, video/x-flv, video/mp4, video/quicktime, video/mpeg, video/ogv, .ts, .mkv, image/*, image/heic, image/heif" containerclassname="_5g_r" multiple="" name="composer_photo[]" display="inline" role=

selenium.common.exceptions.NoSuchWindowException: Message: no such window error clicking an element within an iframe using Selenium and Python

不羁岁月 提交于 2021-02-02 09:53:48
问题 I'm starting with Selenium and have a question, basically I don't understand why when I switch to an iframe and select one of the elements I constantly get: selenium.common.exceptions.NoSuchWindowException: Message: no such window (Session info: chrome=84.0.4147.89) This is the relevan code, firstly I click on some element of the DOM containing the iframe that actually updates the iframe content and then select the iframe, switch to it and then select the element I want inside the HTML

selenium.common.exceptions.NoSuchWindowException: Message: no such window error clicking an element within an iframe using Selenium and Python

倾然丶 夕夏残阳落幕 提交于 2021-02-02 09:53:45
问题 I'm starting with Selenium and have a question, basically I don't understand why when I switch to an iframe and select one of the elements I constantly get: selenium.common.exceptions.NoSuchWindowException: Message: no such window (Session info: chrome=84.0.4147.89) This is the relevan code, firstly I click on some element of the DOM containing the iframe that actually updates the iframe content and then select the iframe, switch to it and then select the element I want inside the HTML

selenium.common.exceptions.NoSuchWindowException: Message: no such window error clicking an element within an iframe using Selenium and Python

倖福魔咒の 提交于 2021-02-02 09:53:24
问题 I'm starting with Selenium and have a question, basically I don't understand why when I switch to an iframe and select one of the elements I constantly get: selenium.common.exceptions.NoSuchWindowException: Message: no such window (Session info: chrome=84.0.4147.89) This is the relevan code, firstly I click on some element of the DOM containing the iframe that actually updates the iframe content and then select the iframe, switch to it and then select the element I want inside the HTML

Automating jQuery based bootstrap dropdown using Selenium and Java

三世轮回 提交于 2021-02-02 09:38:30
问题 I am trying to list all elements from the bootstrap dropdown and then select a certain value. However, it returns 0 values. Any suggestions will be greatly appreciated. driver.findElement(By.id("imgSelectButton")).click(); Thread.sleep(3000); List<WebElement> list = driver.findElements(By.xpath("//ul/li[@class='logoSelectOpt']//li")); System.out.println(list.size()); for(int i=0; i<list.size(); i++){ System.out.println(list.get(i).getText()); if (list.get(i).getText().contains("History")){