[Solved] didnot search on searchbox in instagram

Use actions class and try Actions actions = new Actions(driver); actions.moveToElement(driver.findElements(By.xpath(“//div[@class=”_9AhH0″]”)); actions.click(); actions.sendKeys(“tanishq”); solved didnot search on searchbox in instagram

[Solved] How can we assess the difficulty of automating the front-end of a web app? [closed]

This is a very tricky question indeed. I’ll give it a shot, but mind you I’m barely going to scratch the surface with this. Disclaimer: What I’ve written now, especially considering the speed with which the web is moving forward/changing (new W3C standards, new frameworks, new levels of abstraction over the same old programming principles), … Read more

[Solved] Syntax error on token “else”, delete this token [closed]

your code is missing braces ( that’s these: {} BTW). It’s ok if your if statement involves only a single line, however i’d advise to use them anyway for readability. Overall, your code should look similar to: import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.ie.InternetExplorerDriver; public class gg { public static void main(String[] args) { … Read more

[Solved] Extract a number from a string getting number format exception

You need to get the result by using substring method as below String total_points = potential_points.getText(); int startIndex=total_points.indexOf(“:”)+2; int endIndex=total_points.length(); String result=total_points.substring(startIndex,endIndex); int no=Integer.parseInt(result); Simplified the above code as below String result=total_points.substring(total_points.indexOf(“:”)+2,total_points.length()); int no=Integer.parseInt(result); 15 solved Extract a number from a string getting number format exception

[Solved] How to get product price from json [closed]

What happens? You try to find a price in the json, but there is no price information available. How to get the price? You have to call another api with the productId per item: requests.get(‘https://www.adidas.com/api/search/product/’+item[‘productId’],headers=headers) Example import requests url = “https://www.adidas.com/api/plp/content-engine?” params = { ‘sitePath’: ‘us’, ‘query’: ‘women-athletic_sneakers’ } headers = { ‘User-Agent’: ‘Mozilla/5.0 (Windows … Read more

[Solved] How to click on the Search company name button,type company name and search using Selenium and Python?

Try this: from selenium import webdriver import time from selenium.webdriver.common.keys import Keys from bs4 import BeautifulSoup from bs4.element import Tag driver = webdriver.Chrome(“C:/Users/RoshanB/Desktop/sentiment1/chromedriver_win32/chromedriver”) driver.get(‘http://www.careratings.com/brief-rationale.aspx’) time.sleep(4) companyArray = [] try: search = driver.find_element_by_name(‘txtSearchCompany_brief’) search.send_keys(“Reliance Capital Limited”) search.send_keys(Keys.RETURN) time.sleep(4) soup = BeautifulSoup(driver.page_source, ‘lxml’) companies = soup.find(“table”,class_=”table1″) for tag in companies.findChildren(): if isinstance(tag, Tag) and tag.name in ‘a’ … Read more

[Solved] Python selenium drop down menu click

You should use Select() to select an option from drop down as below :- from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By wait = WebDriverWait(driver, 10) element = wait.until(EC.visibility_of_element_located((By.ID, “dwfrm_adyenencrypted_expiryMonth”))) select = Select(element) select.select_by_value(“04”) Edited :- If unfortunately above does not work you can also … Read more

[Solved] How do i get a list of all the urls from a website with python? [closed]

Since all the links have a class in common (class=”blue”), you can select all the web elements using this code, and then get the “href” attribute values: elements = driver.find_elements_by_class_name(‘blue’); urls = [elements.get_attribute(‘href’) for elements in elements] I recommend this site if you want to learn more about Selenium Python : Learn to Locate Elements … Read more

[Solved] How do I make Selenium click on this button?

There are two buttons are present with the same xpath. if you want to click first button then use below code wait = WebDriverWait(browser, 10) button= wait.until(EC.element_to_be_clickable((By.XPATH,'(//button[@class=”Button”])[1]’))) button.click() if you want to click the second button then use below code wait = WebDriverWait(browser, 10) button= wait.until(EC.element_to_be_clickable((By.XPATH,'(//button[@class=”Button”])[2]’))) button.click() solved How do I make Selenium click on … Read more

[Solved] What is the significance of the attribute xpath=”1″ while constructing locators for Selenium tests

That attribute (xpath=”1″) is placed there by a browser extension named CHROPATH. It is provided by a feature they call Dynamic Attribute Support. Scolling down the page one will find a text description of how to use the tool. Scroll to Note: at the bottom of the page, or search for “Note:” within the page … Read more