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
请问 假如一篇文章有多个作者,每个作者对应一张图片, 在entitysipder 里面改如何定义字段类型呢?
现在Demo 里面好像都是单一的类型。 [PropertyDefine(Expression = ".//div[@Class='p-name']/a/em", Length = 100)] public string Name { get; set; }
能实现类似的么? [PropertyDefine(Expression = ".//div[@Class='p-name']/a/em", Length = 100)] public List‘<string’> Name { get; set; }
或者给 每个字段解析成功后能定义个callback 函数也行。 谢谢!
The text was updated successfully, but these errors were encountered:
List 这种解析最早是支持的,只是数据库只有在Mongo才能存这种数据,后来为了简洁就去掉了。你这种其实可以这样实现
[EntityTable("test", "image")] [EntitySelector(Expression = "//...//img")] class Images : SpiderEntity { [PropertyDefine(Expression = "./@src", Length = 500)] public string src { get; set; } [PropertyDefine(Expression = "../../ 相对当前节点往上的XPATH写法", Length = 100)] public string author { get; set; } }
如果不行,则建议你自己实现一个BasePageProcessor
Sorry, something went wrong.
非常感谢。
No branches or pull requests
请问 假如一篇文章有多个作者,每个作者对应一张图片, 在entitysipder 里面改如何定义字段类型呢?
现在Demo 里面好像都是单一的类型。
[PropertyDefine(Expression = ".//div[@Class='p-name']/a/em", Length = 100)]
public string Name { get; set; }
能实现类似的么?
[PropertyDefine(Expression = ".//div[@Class='p-name']/a/em", Length = 100)]
public List‘<string’> Name { get; set; }
或者给 每个字段解析成功后能定义个callback 函数也行。
谢谢!
The text was updated successfully, but these errors were encountered: