When I print this I get:
['Ordinateur', 'Impression', 'Tablette & Téléphonie ', 'Multimédia',...]
What I want instead comes from the following
['Ordinateur', 'Impression', 'Tablette & Téléphonie ', 'Multimédia',...]
I m looking to scrape list of data from the header of a website correctly Here is my code:
from tkinter import *
import tkinter.ttk
from lxml import html
import requests
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support.ui import Select
from time import sleep
import csv
import os
import re
index="https://www.disway.com/"
p=requests.get(index)
pages_s=[]
script= html.fromstring(p.text,parser=html.HTMLParser(encoding='utf-16'))
pages_s.extend(script.xpath('//*[@id="7ea42b1d-f4c2-41af-9908-eaaec09f308c"]/li/a/text()'))
pages_s.extend(script.xpath('//*[@id="7ea42b1d-f4c2-41af-9908-eaaec09f308c"]/li/ul/li/a/text()'))
print(pages_s)