You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: general/using-custom-search-engine-api/README.md
+28-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
To run this:
3
3
-`pip3 install -r requirements.txt`
4
4
- You need to setup a CSE account, check [the tutorial](https://www.thepythoncode.com/article/use-google-custom-search-engine-api-in-python) on how you can set up one.
5
-
- Change `API_KEY` and `SEARCH_ENGINE_ID` to yours, and then:
5
+
- Change `API_KEY` and `SEARCH_ENGINE_ID`variables to yours, and then:
6
6
```
7
7
python search_engine.py "python"
8
8
```
@@ -25,4 +25,31 @@ To run this:
25
25
Description: Looking for Python with a different OS? Python for Windows, Linux/UNIX, Mac OS
26
26
X, Other. Want to help test development versions of Python? Prereleases ...
27
27
URL: https://www.python.org/downloads/
28
+
<..SNIPPED..>
29
+
```
30
+
- You can specify the page number, let's get 3rd result page for instance:
31
+
```
32
+
python search_engine.py "python" 3
33
+
```
34
+
Here is a **truncated output**:
35
+
```
36
+
========== Result #21 ==========
37
+
Title: Python Tutorial - Tutorialspoint
38
+
Description: Python is a general-purpose interpreted, interactive, object-oriented, and high-
39
+
level programming language. It was created by Guido van Rossum during 1985-
0 commit comments