We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
通过 AddEntityType(); 获取busstoplist 下所有P元素的内容 http://wapapp.dy4g.cn/bus/auto/test.php?t=linhtml&busline=1 `
/// <summary> /// 获取车站信息 /// </summary> [Schema("dybus", "BusStation")] [Entity(Expression = ".//div[@class='busstoplist']/div//p", Type = SelectorType.XPath)] class BusStation : BaseEntity { /// <summary> /// 车次信息 /// </summary> [Column] [Field(Expression = "Keyword", Type = SelectorType.Enviroment)] public string Keyword { get; set; } /// <summary> /// 车站唯一ID /// </summary> [Column] [Field(Expression = "./@Id")] public string BusStationId { get; set; } /// <summary> /// 车次路线编号 /// </summary> [Column] [Field(Expression = "./strong/text()")] public string StationNumber { get; set; } /// <summary> /// 车站名称 /// </summary> [Column] [Field(Expression = "./span/text()")] public string Name { get; set; } /// <summary> /// 车站方向 /// </summary> [Column] [Field(Expression = "../@class")] public string BusDirection { get; set; } }
`
数据是能够获取到, 但是获取到的同一条数据插入了两次 请老师看看,是不是我使用姿势不对
The text was updated successfully, but these errors were encountered:
好像还是不行,是不是XPATH有问题啊
这三种方式都试过了,还是不行,在浏览器里面都只匹配出来67次, 但是数据库中,数据都插入了两次
Sorry, something went wrong.
AddEntityType<BusLineCarBatchNo>(); AddEntityType<BusStation>(); AddPipeline(new ConsoleEntityPipeline()); AddPipeline(new MySqlEntityPipeline(DbConnection));
根据页面dom结构,调整AddEntityType分析的顺序,能够正确获取数据!
No branches or pull requests
通过 AddEntityType();
获取busstoplist 下所有P元素的内容
http://wapapp.dy4g.cn/bus/auto/test.php?t=linhtml&busline=1
`
`
数据是能够获取到,
但是获取到的同一条数据插入了两次
请老师看看,是不是我使用姿势不对
The text was updated successfully, but these errors were encountered: