Skip to content

Commit 9e7970f

Browse files
committed
docs(examples): Adds client spider example.
1 parent 4e35d59 commit 9e7970f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/examples/client-spider-scan.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python
2+
3+
from zapv2 import ZAPv2
4+
import time
5+
6+
7+
target = 'http://127.0.0.1' # Change to match the target URL you want to scan
8+
apikey = 'changeme' # Change to match the API key set in ZAP, or use None if the API key is disabled
9+
10+
11+
zap = ZAPv2(apikey=apikey)
12+
13+
print(f'Spidering target {target}')
14+
scanid = zap.clientSpider.scan(url=target)
15+
16+
while (int(zap.clientSpider.status(scanid)) < 100):
17+
print(f"Spider progress %: {zap.clientSpider.status(scanid)}")
18+
time.sleep(2)
19+
20+
print('Spider completed')

0 commit comments

Comments
 (0)