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

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.
主站蜘蛛池模板: 长岭县| 达州市| 潮州市| 吴堡县| 青川县| 淅川县| 淮安市| 巴里| 托克逊县| 大姚县| 祁东县| 遂昌县| 鸡泽县| 泸定县| 松江区| 威海市| 泾源县| 宝丰县| 石渠县| 嘉黎县| 浮山县| 正阳县| 达尔| 松滋市| 都江堰市| 鄂尔多斯市| 容城县| 襄垣县| 文昌市| 洛浦县| 定兴县| 博乐市| 莎车县| 广水市| 连城县| 木兰县| 盐山县| 永仁县| 舞钢市| 晋州市| 尼木县|