0

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.

3
Contributors
3
Replies
14
Views
2 Years
Discussion Span
Last Post by dadaas
0

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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.