Skip to content Skip to sidebar Skip to footer

Returnin Text() From A Td Tag With The Class Name As 'tdlrow'

I am trying to code a script that returns all the text in a TD tag cannot show you full code, but I am using instances = self.driver.find_element_by_xpath('//*[contains(@class, 't

Solution 1:

There are multiple approaches to address the unicode related error while printing to the console as follows:

  • In the first approach you can use encode('utf-8') as follows:

    print(instances.text.encode('utf-8'))
    
  • In the second approach you can append the following line at the top of your python file:

    # -*- coding: utf­-8 ­-*-
    

Post a Comment for "Returnin Text() From A Td Tag With The Class Name As 'tdlrow'"