官术网_书友最值得收藏!

Query parameters

For some HTTP requests, extra information needs to be provided by the client in order to refine the request. This is usually done in two different ways. For HTTP GET requests, there is a defined way to include extra information in a request using the URL. Placing a ? at the end of a URL defines the end of the URL resource, and the next section defines query parameters. These parameters are key-value pairs defining the extra information sent to the server. The key value pairs are written as follows:

key1=value1&key2=value2&key3 ...

You will see this quite commonly when you are performing searches. As a hypothetical example, if you were on a site searching for shoes, you might encounter a paginated results page and the URL might look something like this:

https://buystuff.com/product_search?keyword=shoes&page=1

Notice that the resource is product_search, which is followed by the query parameters for the keyword and the page. This way, you can collect the products from all pages by adjusting the query.

Query parameters are defined by the website. There are no standard parameters that all websites must have, so it will take some investigation on your part depending on the site you are scraping.
主站蜘蛛池模板: 梅河口市| 堆龙德庆县| 公主岭市| 常宁市| 平湖市| 太和县| 五大连池市| 铜川市| 含山县| 乌兰县| 邢台市| 灌阳县| 海宁市| 西林县| 宁强县| 江川县| 邢台市| 土默特右旗| 大庆市| 钦州市| 定日县| 平遥县| 杭锦后旗| 茌平县| 龙川县| 桃源县| 济源市| 宁远县| 翼城县| 延庆县| 西宁市| 嘉善县| 泾川县| 郴州市| 河津市| 博爱县| 仪陇县| 霍州市| 宁夏| 宜川县| 阿荣旗|