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

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.
主站蜘蛛池模板: 内江市| 安西县| 平湖市| 新乡市| 沁水县| 灯塔市| 海南省| 祁门县| 岚皋县| 沙坪坝区| 卢湾区| 长宁县| 邢台县| 贵溪市| 荥阳市| 白河县| 育儿| 巴楚县| 建昌县| 巴塘县| 黑山县| 阿尔山市| 旬阳县| 凌海市| 樟树市| 黄石市| 南靖县| 平塘县| 德清县| 菏泽市| 浪卡子县| 勃利县| 依安县| 文化| 晋宁县| 瑞安市| 巨野县| 友谊县| 洛川县| 名山县| 凤翔县|