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
- Performs google search of topic stated in config file
5
+
- Go to news tab of google search results
6
+
- Extract each news heading and link from first search results page
7
+
- Save search results to file
8
+
- Read file to send email to address in config file
9
+
10
+
## How to use
11
+
12
+
### 1. Setup Python and modules
13
+
14
+
Python and the following modules must be installed on the computer running this script.
15
+
16
+
Install Python and pip:
17
+
```
18
+
sudo apt-get install python
19
+
sudo apt-get install pip
20
+
```
21
+
22
+
Install selenium:
23
+
```
24
+
pip install -r requirements.txt
25
+
```
26
+
27
+
### 2. Download browser and driver
28
+
29
+
You need to have either Firefox or Chrome installed. You also need the corresponding driver for the browser.
30
+
31
+
For Firefox download geckodriver:
32
+
https://github.com/mozilla/geckodriver/releases
33
+
34
+
For Chrome download chromedriver:
35
+
https://chromedriver.chromium.org/downloads
36
+
37
+
38
+
### 3. Configure config.ini
39
+
40
+
Example configuration:
41
+
```
42
+
[your_settings]
43
+
driver = geckodriver
44
+
search_topic = Nintendo news
45
+
email_subject = My newsletter for Nintendo
46
+
email_smtp = smtp.live.com
47
+
sender_email_address = sendingemail@live.com
48
+
email_password = yourpassword
49
+
receiver_email_address = receiveremail@live.com
50
+
```
51
+
52
+
Note:
53
+
- The "email_smtp" is the mail server of the sender.
54
+
- See [this link](https://www.arclab.com/en/kb/email/list-of-smtp-and-pop3-servers-mailserver-list.html) to find a list of smtp servers and insert the correct one for your email address.
55
+
56
+
57
+
### 4. Run program
58
+
59
+
```
60
+
python google-search-newsletter.py
61
+
```
62
+
63
+
You should receive an email in the receiver address containing the news headlines and links.
64
+
65
+
### 5. Setup running schedule using Crontab Linux utility
66
+
67
+
Schedule the time and frequency to run this script. See the [Crontab man page](https://linux.die.net/man/5/crontab) for more info.
68
+
69
+
Open the crontab file for editing. Run on command line:
70
+
```
71
+
crontab -e
72
+
```
73
+
74
+
Add the following to the end of the crontab file. This example will run the script everyday at 07:05am. Edit according to your needs.
75
+
```
76
+
# needed if headless=false
77
+
DISPLAY=:0
78
+
79
+
# at 07:05am go to directory of script and run. log output and potential errors to file 'crontab.log'
0 commit comments