I am new to Python and web scraping and this is my first ever question on stackoverflow. I watched several tutorials and then I tried to extract data from the table on this page: https://www.wunderground.com/hourly/ir/tehran/date/2021-04-14.
The table: TABLE
But the problem is that it seems like I can not access the right class in scrapy shell. This is my spider:
import scrapy
class SpSpider(scrapy.Spider):
name = 'sp'
start_urls = ['http://https://www.wunderground.com/hourly/ir/tehran/date/2021-04-14/']
def parse(self, response):
time = response.css('span.ng-star-inserted').extract()
And this is what I get in the terminal:
In [4]: response.css('span.ng-star-inserted::text').extract()**
Out[4]:
['\xa0',
'F',
'Night',
'\xa0',
'in',
'\xa0',
'miles',
'\xa0',
'F',
'\xa0',
'%',
'\xa0',
'in',
'\xa0',
'in']
I wrote this with the purpose of getting just a single data (here 12 which is the time in the table). But as you can see, the list contents are not relevant. How should I access the data?
P.S: I am working on python 3.8