我django-dynamic-scraper
在我的一个应用程序中使用,我已经阅读了文档,以下是我的设置:
我正在使用的对象类 url 是:http://www.example.com/products/brandname_products.html
网站上的分页类似于以下内容。
第 1http://www.example.com/products/brandname_products.html
页: 第 2http://www.example.com/products/brandname_products2.html
页: 第 3http://www.example.com/products/brandname_products3.html
页: 第 4 页:http://www.example.com/products/brandname_products4.html
上述brandname
网址是动态的,取决于品牌的产品页面。我不能为每个品牌使用不同的刮板,因为有超过 10000 个品牌,所以我尝试使用单个刮板对象。
在我使用的刮板对象中,我定义了分页选项如下:
pagination_type
: RANGE_FUNCT
pagination_append_str
: _products{page}.html
pagination_page_replace
:1,100,2
但刮板请求以下分页网址
http://www.example.com/products/brandname_products.html_products2.html
http://www.example.com/products/brandname_products.html_products3.html
http://www.example.com/products/brandname_products.html_products4.html
代替
http://www.example.com/products/brandname_products2.html
http://www.example.com/products/brandname_products3.html
http://www.example.com/products/brandname_products4.html
_products.html
问:为什么将替换字符串附加到 url 的末尾,而不是在对象类 url中实际替换它?我做错了什么,我该如何解决这个问题。