繁体   English   中英

Xpath 来自以下属性

[英]Xpath from the following properties

我想 select 以下网页的日期+时间

https://geoinfo.nmt.edu/nmtso/events/home.cfml

第一个的 xpath 是/html/body/div/div[2]/main/div[2]/div[3]/table/tbody/tr[1]/td[1]所以我想要一个xpath 为每一行,所以我可以用 scrapy 提取它。 有什么办法可以做到这一点? 谢谢

@Norhther,根据您的问题,使用scrapy所需的最小工作解决方案如下:

代码

import scrapy
class DTSpider(scrapy.Spider):
    name = "dt"

    start_urls = ['https://geoinfo.nmt.edu/nmtso/events/home.cfml']

    def parse(self, response):
        for dateTime in response.xpath('/html/body/div/div[2]/main/div[2]/div[3]/table/tbody/tr'):

            yield {
                'DateTime': dateTime.xpath('.//td[1]/text()').get()}

Output:

{'DateTime': '2021-09-28 10:14:37.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-27 11:20:41.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-26 16:26:26.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-26 16:19:25.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-25 21:50:04.300'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-23 00:44:34.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-22 22:05:56.300'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-22 03:20:19.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-22 00:25:44.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-21 08:15:45.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-21 04:19:43.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-20 23:31:45.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-20 17:46:29.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-20 09:48:36.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-19 12:37:22.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-18 21:14:11.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-18 15:51:27.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-17 17:37:17.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-16 21:41:49.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-15 09:40:38.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-13 13:28:36.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-13 11:36:02.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-13 05:56:08.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-12 06:24:33.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-11 00:27:06.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-10 22:13:09.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-10 20:13:10.300'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-10 11:51:14.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-10 11:20:39.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-10 00:41:11.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-09 22:04:38.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-09 04:03:14.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-09 01:26:49.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-08 23:47:13.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-08 06:41:58.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-08 03:37:06.300'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-08 00:24:33.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-07 09:47:16.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-07 08:29:09.300'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-05 21:23:40.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-05 16:06:53.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-05 15:20:57.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-05 11:59:29.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-03 08:47:54.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-03 03:05:39.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-02 05:27:09.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-01 21:47:32.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-01 17:52:40.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-01 08:54:10.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-09-01 07:19:23.300'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-31 10:17:19.400'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-30 12:43:02.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-28 19:59:56.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-27 06:48:11.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-26 04:18:49.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-26 02:16:36.300'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-24 10:08:12.400'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-24 06:14:25.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-22 08:24:54.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-22 04:23:09.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-21 05:08:34.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-17 22:24:07.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-15 14:56:22.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-15 08:32:43.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-13 04:54:45.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-13 00:54:55.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-12 19:24:14.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-10 07:29:46.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-06 10:31:17.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-04 06:53:57.400'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-08-04 03:06:21.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-31 11:43:21.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-31 11:29:50.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-28 23:50:22.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-28 19:20:39.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-25 15:13:31.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-22 12:44:18.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-21 17:30:39.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-19 11:23:25.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-13 19:49:38.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-11 21:05:37.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-09 07:03:50.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-08 04:10:58.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-03 23:46:12.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-07-01 02:51:28.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-05-16 16:56:44.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-05-13 04:53:49.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-05-11 22:47:20.400'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-05-10 11:47:47.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-05-10 04:36:41.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-04-15 15:22:01.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-04-15 05:53:35.300'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-03-19 14:18:20.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-03-19 08:02:15.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-03-19 02:43:28.300'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-02-27 07:44:27.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-02-22 07:51:38.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-02-17 00:08:00.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-02-12 15:59:48.400'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-02-11 10:47:19.400'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-02-11 08:47:36.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-02-10 19:59:48.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-02-10 09:38:00.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-02-08 08:01:24.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2021-01-08 04:37:32.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-12-26 01:54:42.300'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-12-23 11:01:17.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-12-23 10:57:40.600'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-11-24 08:21:18.900'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-11-18 04:28:46.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-11-12 15:22:08.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-11-12 11:51:00.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-11-09 02:25:23.0'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-11-06 01:25:01.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-11-03 23:41:54.700'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-11-01 21:09:19.200'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-10-30 14:41:36.400'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-10-28 07:56:18.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-10-16 07:45:40.500'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-10-12 04:03:19.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-10-11 18:05:16.100'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-10-01 20:58:21.800'}
2021-12-02 02:04:06 [scrapy.core.scraper] DEBUG: Scraped from <200 https://geoinfo.nmt.edu/nmtso/events/home.cfml>
{'DateTime': '2020-10-01 20:49:26.400'}
2021-12-02 02:04:06 [scrapy.core.engine] INFO: Closing spider (finished)
2021-12-02 02:04:06 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'downloader/request_bytes': 317,
 'downloader/request_count': 1,
 'downloader/request_method_count/GET': 1,
 'downloader/response_bytes': 184469,
 'downloader/response_count': 1,
 'downloader/response_status_count/200': 1,
 'elapsed_time_seconds': 6.103253,
 'finish_reason': 'finished',
 'finish_time': datetime.datetime(2021, 12, 1, 20, 4, 6, 496048),
 'item_scraped_count': 123,

xpath 将是 //table/tbody/tr/td[1] 或在 scrapy 中:

daterows = response.xpath("//table/tbody/tr/td[1]").getall()

应该返回 123 行

您可以使用此 xpath 获取每行的日期+时间值-

//tbody//tr/td[1]/text()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM