82254/is-there-way-to-store-this-text-in-list-using-selenium-python
The text from the website is in the class "textLayer". Is there a way to access every div inside that class and get the text? In this case I want to store "recommended", "by", "most", etc.
Try using this code snippet to resolve your issue:
public static WebDriver driver; public static String driverPath = ".\\chromedriver.exe"; public static void main(String[] args) { // Setting up Chrome driver path. System.setProperty("webdriver.chrome.driver", driverPath); // Launching Chrome browser. driver = new ChromeDriver(); driver.get("https://www.justdial.com/Bangalore/Bakeries"); List<WebElement> bakeries = driver.findElements(By.className("store-name")); System.out.println(bakeries.size()); for (WebElement webElement : bakeries) { String name = webElement.getText(); System.out.println(name); } }
The in-built variables and functions are defined ...READ MORE
Every occurence of "foreach" I've seen (PHP, ...READ MORE
Hi. Nice question. Here is the simplified answer ...READ MORE
Well, you are using a complex way. ...READ MORE
can you give a few sample projects ...READ MORE
You can use the linespace function. It ...READ MORE
This can be easliy done by using ...READ MORE
In Python, you can use ''' some ...READ MORE
If the user hits Ctrl+C, I want ...READ MORE
You can write a simple loop to ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.