Baidu
Classes
BaiDuItem
Bases: BaseSearchItem
Represents a single BaiDu search result item.
A class that processes and stores individual search result data from BaiDu image search.
Attributes:
Name | Type | Description |
---|---|---|
origin |
dict
|
The raw, unprocessed data of the search result item. |
thumbnail |
str
|
URL of the thumbnail image. |
url |
str
|
URL of the webpage containing the original image. |
Source code in PicImageSearch/model/baidu.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
Functions
__init__(data, **kwargs)
Initialize a BaiDu search result item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict[str, Any]
|
A dictionary containing the raw search result data from BaiDu. |
required |
**kwargs
|
Any
|
Additional keyword arguments passed to the parent class. |
{}
|
Source code in PicImageSearch/model/baidu.py
17 18 19 20 21 22 23 24 |
|
BaiDuResponse
Bases: BaseSearchResponse[BaiDuItem]
Encapsulates a complete BaiDu reverse image search response.
A class that handles and stores the full response from a BaiDu reverse image search, including multiple search results.
Attributes:
Name | Type | Description |
---|---|---|
origin |
dict
|
The complete raw response data from BaiDu. |
raw |
list[BaiDuItem]
|
List of processed search results as BaiDuItem instances. |
url |
str
|
URL of the search results page on BaiDu. |
Source code in PicImageSearch/model/baidu.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
Functions
__init__(resp_data, resp_url, **kwargs)
Initialize a BaiDu search response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resp_data
|
dict[str, Any]
|
The raw JSON response from BaiDu's API. |
required |
resp_url
|
str
|
The URL of the search results page. |
required |
**kwargs
|
Any
|
Additional keyword arguments passed to the parent class. |
{}
|
Source code in PicImageSearch/model/baidu.py
57 58 59 60 61 62 63 64 65 |
|