Where a link ends in plain text
On a web page, a link's address is stored apart from its text, so there's no doubt where it starts and stops. In plain text there's no such marker, so the extractor has to decide. It starts at http://, https:// or www., stops at the first space, quote mark, angle bracket or backtick, and then trims anything that probably belongs to the sentence rather than the link.
| In your text | Extracted |
|---|---|
| Read it at https://example.com/report. | https://example.com/report |
| (see www.example.com/page) | www.example.com/page |
| https://en.wikipedia.org/wiki/Mercury_(planet) | https://en.wikipedia.org/wiki/Mercury_(planet) |
| Slides: "https://example.com/b" | https://example.com/b |
| https://maps.example.com/?q=40.7,-74.0 | https://maps.example.com/?q=40.7,-74.0 |
| Check www.city.gov/permits... | www.city.gov/permits |
| See [https://example.com/x] and visit www.example.com! | https://example.com/x and www.example.com |
The standard for web addresses, RFC 3986, describes the same problem. In running text, addresses are usually set off by double quotes, angle brackets or plain spaces, and those wrappers aren't part of the address. When you write links into an email yourself, giving each one its own line spares everyone's software from guessing.
Long links that wrap onto a second line are a common casualty, especially in plain-text emails. The same standard says whitespace added to split an address across lines should be ignored, but a pattern can't tell a wrapped link from a link followed by a new sentence, so the extractor stops at the line break. If a link looks cut short, join its two halves in your text and extract again.
Why near-duplicate links are kept
Removing duplicates here is exact, capital letters included, so HTTPS://Example.com/Deck, https://example.com/Deck and https://example.com/deck stay as three entries. That's deliberate. The scheme and domain of an address ignore case, but the path after the domain doesn't have to, and on many servers /Deck and /deck are different pages.
Other near-twins are left alone for the same reason: a trailing slash, http versus https, www versus no www, or tracking tags like ?utm_source=newsletter. If you know a site treats them as the same, tidy them first and extract again.
Example: Stripping tracking tags from newsletter links
- Paste the links into Find and Replace and turn on Regular expression
- Find \?utm_\S* and replace it with nothing
- https://shop.example/boots?utm_source=news&utm_medium=email becomes https://shop.example/boots
Extract again, and copies that differed only by their tracking tags collapse into one.
Links the extractor skips
- Bare domains such as example.com. File names like notes.txt, names like Node.js and a missing space after a full stop all look the same to a pattern.
- Email addresses and mailto: links. The Email Extractor handles those.
- Other schemes, such as ftp:// addresses and tel: phone links.
- Relative links in page source, such as /about or ../images/map.png. They only work combined with the page's own address.
- The address hidden behind linked words. Copy a web page as text and a link labeled “Click here” arrives as just “Click here”.
How to get every link from a web page
Because copied page text loses the addresses behind linked words, the most complete source is the page's HTML. In most desktop browsers you can open it with Ctrl+U on Windows or Option+Command+U on a Mac (Safari needs its developer features turned on first), then select all and paste it here.
Expect more than you bargained for. Page source lists every image, script, stylesheet and font file the page loads, often dozens of addresses you didn't mean to collect. Sort the result and the links you care about, usually the ones on the same site, are easier to pick out.
Sorting is alphabetical, so https:// links and www. links land in separate groups, and the http and https versions of the same site sit apart too.
PDFs work like web pages here. A clickable link in a PDF usually keeps its address separately from the words you see, so copying the text gets the words without the address. Links that are printed out in full in the text itself copy over fine.