Sub topic 3
Running your first crawl in Spider mode
This chapter assumes you know basic HTML tags, HTTP status codes, and what robots.txt is. It also assumes you have permission to crawl the site and have installed the SEO Spider. Here you will run a first crawl and check that it finished correctly.
Before you start
Spider mode follows links from a start URL, as covered in the chapter on how the crawler discovers URLs. It is the default mode. Check the mode under Mode > Spider.
Use a start URL that matches the canonical version of your site. If your site lives at https://www.example.com, do not start from http://example.com. The crawler treats a different subdomain as external by default, so the wrong host gives you a small, misleading crawl.
Run the crawl in the interface
- Open the SEO Spider and confirm that Mode is set to Spider.
- Type the full start URL, including
https://, into the box at the top. - Click Start.
- Watch the progress bar and the URL counter at the bottom right. Wait until progress reaches 100%.
The free version stops at 500 URLs. If your site is larger, the crawl will stop at that limit. The results are still useful for learning, but they are incomplete.
Run the same crawl from the command line
The same crawl can run without the interface. This is useful later for automation. The command below crawls a site, saves the crawl file and exports the Internal tab.
screamingfrogseospider --crawl https://www.example.com \
--headless \
--save-crawl \
--output-folder /tmp/sf-crawl \
--timestamped-output \
--export-tabs "Internal:All"--timestamped-output puts each run in its own dated folder, so a new crawl does not overwrite an old one. Note that with this flag the CSV is written inside a timestamped subfolder of /tmp/sf-crawl, so adjust the path in the next script to match.
Check the results
The following script reads the exported Internal tab and prints every URL that returned a 4xx or 5xx status code.
import csv
with open("/tmp/sf-crawl/internal_all.csv", newline="", encoding="utf-8-sig") as f:
for row in csv.DictReader(f):
if row["Status Code"].startswith(("4", "5")):
print(row["Status Code"], row["Address"])The utf-8-sig encoding removes the byte order mark that the export may contain. Without it, the first column name can be read incorrectly.
Common first-crawl problems
| Symptom | Likely cause |
|---|---|
| Only one URL found | The start page blocks crawling in robots.txt, or its links are added by JavaScript |
| Crawl stops at 500 URLs | Free version limit |
| Many URLs with `?sessionid=` | Session parameters create duplicates. Exclude them. |
| Status code 0 | The request failed before a response, for example a DNS or connection error |
For the session parameter case, add this rule under Configuration > Exclude:
.*\?sessionid=.*Exercise
You start a crawl at http://example.com, but your site redirects to https://www.example.com and the crawl finds only one URL. What should you change, and why?
Show answer
Start the crawl from the canonical URL, https://www.example.com. The spider treats a different host as external, so a start URL on the wrong host stops after the redirect instead of following the site's internal links.