lundi 27 septembre 2021

How to remove redundant spaces after I pull data with selenium

how can I remove redundant spacing after I pull some element data with selenium

My output lookslike:

                    Telefon:
        
    
            
    216 593 17 20 - 21 - 22
        

                                            
    
            
                    Websitesi:
        
    
    http://www.an-ko.com


                                            

    
            
                    Email:
        
    
    info@anadolukompozit.com

and I want to remove spaces from this here's the script I use

from selenium import webdriver

driver = webdriver.Safari()

driver.get("https://iayosb.com/firmalar/anadolu-kompozit-mam-san-ve-tic-a-s/")
article = driver.find_elements_by_xpath("//div[@class='w2dc-fields-group w2dc-fields-group-1']")
for elem in article:
    print(elem.text)

driver.quit()

        

Thanks is advance I really appreciate it




Aucun commentaire:

Enregistrer un commentaire