Answer the question
In order to leave comments, you need to log in
There was a problem with importing data from selenium to csv. How to solve?
Here such problem arose. Why are there commas?
The code is
import csv
from selenium import webdriver
from selenium.webdriver.common.by import By
import json
def main():
options=webdriver.FirefoxOptions()
options.set_preference('dom.webdriver', False)
options.set_preference(' dom.webnotifications.enabled', False)
options.set_preference('media.volume_scale', "0.0")
browser=webdriver.Firefox(options=options)
browser.get(' https://www.talabat.com/bahrain/ restaurant/41468/m... ')
name_of_restauran=browser.find_element(By.TAG_NAME,'h1')
with open('restauran_name.csv',
writer=csv.writer(file)
writer.writerow(name_of_restauran.text)
browser.close()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question