Skip to content

Commit 0d9d2b3

Browse files
authored
Merge pull request #3 from testdrivenio/updates
Updates
2 parents 0fcc0c3 + 5050761 commit 0d9d2b3

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Michael Herman
3+
Copyright (c) 2019 Michael Herman
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Check out the [blog post](https://testdriven.io/concurrent-web-scraping-with-sel
88

99
1. Fork/Clone
1010

11-
1. Create and activate a virtualenv
11+
1. Create and activate a virtual environment
1212

1313
1. Install the requirements
1414

@@ -17,27 +17,29 @@ Check out the [blog post](https://testdriven.io/concurrent-web-scraping-with-sel
1717
1. Add the token to your environment:
1818

1919
```sh
20-
$ export DIGITAL_OCEAN_ACCESS_TOKEN=[your_token]
20+
(env)$ export DIGITAL_OCEAN_ACCESS_TOKEN=[your_token]
2121
```
2222

2323
1. Spin up four droplets and deploy Docker Swarm:
2424

2525
```sh
26-
$ sh project/create.sh
26+
(env)$ sh project/create.sh
2727
```
2828

2929
1. Run the scraper:
3030

3131
```sh
32-
$ NODE=$(docker service ps --format "{{.Node}}" selenium_hub)
33-
$ for i in {1..8}; do {
34-
python project/script.py ${i} $(docker-machine ip $NODE) &
35-
};
36-
done
32+
(env)$ docker-machine env node-1
33+
(env)$ eval $(docker-machine env node-1)
34+
(env)$ NODE=$(docker service ps --format "{{.Node}}" selenium_hub)
35+
(env)$ for i in {1..8}; do {
36+
python project/script.py ${i} $(docker-machine ip $NODE) &
37+
};
38+
done
3739
```
3840

3941
1. Bring down the resources:
4042

4143
```sh
42-
$ sh project/destroy.sh
44+
(env)$ sh project/destroy.sh
4345
```

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
version: '3.5'
1+
version: '3.7'
22

33
services:
44

55
hub:
6-
image: selenium/hub:3.9.1
6+
image: selenium/hub:3.141.59
77
ports:
88
- 4444:4444
99
deploy:
@@ -14,7 +14,7 @@ services:
1414
- node.role == worker
1515

1616
chrome:
17-
image: selenium/node-chrome:3.9.1
17+
image: selenium/node-chrome:3.141.59
1818
volumes:
1919
- /dev/urandom:/dev/random
2020
depends_on:

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
beautifulsoup4==4.6.0
2-
requests==2.18.4
3-
selenium==3.8.1
1+
beautifulsoup4==4.7.1
2+
requests==2.21.0
3+
selenium==3.141.0

0 commit comments

Comments
 (0)