-
Join our Telegram chat: https://t.me/a_parser_enDismiss Notice
Formatting and substitutions of requests
-
Query format - allows to add substitutions and formating request to the necessary look using templates, is applied to each request
There are 2 methods to specify a template:
- General format of requests, it is processed by the first and supports substitutions
- Request format for each parser - allows to set a specific format for separate parsers
General format of request is set in a look
Request format for a parser 1 remained invariable, the parser 1 will parsing request http://google.comRequest format for a parser 2 looks as follows:
Templates in requests(top)
In a format of request Template Toolkit is fully supported, as variables are available:
- $query - request after formatting through the general format of result
- $query.num - sequence number of request
- $query.lvl - the request nesting level when using the options Parse to level or Parse all results
- $query.orig - the initial request before formatting
- $query.first - the first request when using the options Parse to level or Parse all results
- $query.prev - shows the query on the previous level, works for HTML::LinkExtractor, tools.query.add and JS parsers (this.query.add)
- All variables, created through the Query builder
Macroses of substitutions(top)
The general format of request supports the following macroses:
Macroses of substitutions can be combined, complex example:
Total number of requests will correspond to multiplication of possible combinations:1 request (viagra) x 3 zones ({subs:zones}) x 676 character variations ({az:aa:zz}) = 2028 requests
violentycat, Support Денис, vipuncle and 2 others like this.