0
with open('table.csv', 'w', encoding = 'utf8', newline = '') as f:
   thewriter = writer(f)
   headers = ['CONFEDERATION', 'TOTAL', 'YEARS']
   thewriter.writerow(headers)
   print("CONFEDERATION           "+"             TOTAL"+"             YEARS")
      
   for r in range(2, row_count+1):
      for p in range(1, column_count+1):
         value=driver.find_element_by_xpath("/html/body/div[3]/div[3]/div[5]/div[1]/table[4]/tbody/tr["+str(r)+"]/td["+str(p)+"]")
         >>>print(value, '  ')   **This is where i have the issue** 
      >>>print()

I don't know how to go about the remaining part.

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153

1 Answers1

0

I don't really understand what are you trying to do here exactly, seems like you are opening a csv file, then adding a header and looping thorough the table. I'd suggest you to look into dataframes and the pandas module. It's really easy to read/write csv files with it.

b0zg0r
  • 85
  • 5