上面是该页面的链接
:https://i.stack.imgur.com/8bhzV.png
红色标记的框号是我试图通过xpath获得的
:https://i.stack.imgur.com/mca05.png
红色标记框是同一项目的检查线。我的代码在下面
**scrapy shell**
**fetch("http://mnregaweb4.nic.in/netnrega/asset_report_dtl.aspx?lflag=eng&state_name=WEST%20BENGAL&state_code=32&district_name=NADIA&district_code=3201&block_name=KRISHNAGAR-I&block_code=&panchayat_name=DOGACHI&panchayat_code=3201009009&fin_year=2020-2021&source=national&Digest=8+kWKUdwzDQA1IJ5qhD8Fw")**
**assetid = response.xpath("//div[3]/center/table[2]/tbody/tr[4]/td[2]")**
**assetid**
**[]**(This is what it returns.)
**assetid = response.xpath("//div[3]/center/table[2]/tbody/tr[4]/td[2]/text()")**(I tried this also)
**assetid**
**[]**(This is what it returns.)
当使用视图(响应)时,它会显示true&;在浏览器中打开同一页
我的代码在下面
当您说get end of xpath时,您将打印您期望的内容,我也会更新您的xpath:
相反,这是:
使用以下命令:
我希望它能起作用
相关问题 更多 >
编程相关推荐