Hi, i m new and i will sure seek for some help also i will try to help others as well with my for now limited knowledge of Python.

So here is my problem:

I m learnign and i want to learn how to scrape things. i did scrape some usual things, but now i m scraping using selenium and using to scrape and create lists.

here is my error:

    proxy = driver.find_elements_by_xpath("/html/body/section/section[4]/section[1]/div/table/tbody/tr/td[2]").string
AttributeError: 'list' object has no attribute 'string'

Here is my code:

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait

import unittest


driver = webdriver.Firefox()
driver.get("http://proxylist.hidemyass.com/")
proxy = driver.find_elements_by_xpath("/html/body/section/section[4]/section[1]/div/table/tbody/tr/td[2]").string
print('proxy')

Thanks for your time and help.

What happens if you leave .string off?
Also use print(proxy)

Yes i m active on 3 forums and 2 python chats. And it is interesting people give you examples and all of them solve the same problem in different way.

So i learn today that if i want to read or print a list from variable i need to use loop.

But what if i want to convert this list to single item? like all proxies int he list place inside 1 item. Is that possible?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.