Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99018

How to remove coma from web element in python?

$
0
0

How to remove , from WebElement?

Details:

I scraped a web page using selenium but from that text I want to remove ,

For Example:

If I scrap hey, welcome 2020 before this will enter on my csv file I want to remove ,

Here is my code:

if (driver.find_elements_by_css_selector('.restaurants-detail-overview-cards-LocationOverviewCard__addressLink--1pLK4 ._2wKz--mA .restaurants-detail-overview-cards-LocationOverviewCard__detailLinkText--co3ei')):
    address = driver.find_elements_by_css_selector('.restaurants-detail-overview-cards-LocationOverviewCard__addressLink--1pLK4 ._2wKz--mA .restaurants-detail-overview-cards-LocationOverviewCard__detailLinkText--co3ei')

else:
    address = 'NONE'

with open(save,'a',encoding='utf-8') as s:
    for i in range(1):
        addresst = address

        if addresst == 'NONE':
            addresst = str(address)
        else:
            addresst = address[i].text

        s.write(addresst + '\n')

Viewing all articles
Browse latest Browse all 99018

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>