blob: b49e5610ae7229ca820eae8a641018910d2d2f46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="results">
<div id="test1">
<div data-layout="organic">
<a href="https://foobar.com" data-testid="result-title-a">Extract domain from href (absolute URL).</a>
</div>
</div>
<div id="test2">
<div data-layout="organic">
<a href="https://foo.com" data-testid="result-title-a">Extract domain from href (absolute URL) - link1.</a>
<a href="https://bar.com" data-testid="result-title-a">Extract domain from href (absolute URL) - link2.</a>
<a href="https://baz.com" data-testid="result-title-a">Extract domain from href (absolute URL) - link3.</a>
<a href="https://qux.com" data-testid="result-title-a">Extract domain from href (absolute URL) - link4.</a>
</div>
</div>
<div id="test3">
<div data-layout="organic">
<a href="/dummy-page" data-testid="result-title-a">Extract domain from href (relative URL).</a>
</div>
</div>
<div id="test4">
<a href="#" data-dtld="www.abc.com">Extract domain from data attribute.</a>
</div>
<div id="test5">
<a href="#" data-dtld="www.foo.com">Extract domain from data attribute - link1.</a>
<a href="#" data-dtld="www.bar.com">Extract domain from data attribute - link2.</a>
<a href="#" data-dtld="www.baz.com">Extract domain from data attribute - link3.</a>
<a href="#" data-dtld="www.qux.com">Extract domain from data attribute - link4.</a>
</div>
<div id="test6">
<a href="example.com/testing?ad_domain=def.com" class="js-carousel-item-title">Extract domain from an href's query param value.</a>
</div>
<div id="test7">
<a href="https://example.com/test?ad_domain=https://def.com/path/to/nowhere">Extract domain from an href's query param value containing an absolute href.</a>
</div>
<div id="test8">
<a href="https://example.com/test?ad_domain=def.com/path/to/nowhere">Extract domain from an href's query param value containing a relative href.</a>
</div>
<div id="test9">
<a href="https://example.com/test?dummy_key=foo.com">Param value is missing from the href.</a>
</div>
<div id="test10">
<!-- Extraction preserves order of domains within the page. -->
<div data-layout="organic">
<a href="https://foobar.com" data-testid="result-title-a">Extract domain from href (absolute URL).</a>
<a href="#" data-dtld="www.abc.com">Extract domain from data attribute.</a>
<a href="example.com/testing?ad_domain=def.com" class="js-carousel-item-title">Extract domain from an href's query param value.</a>
</div>
</div>
<div id="test11">
<a href="nomatches.com">Link that doesn't match a selector.</a>
</div>
<div id="test12">
<a href="#" data-dtld="">Data attribute is present, but value is missing.</a>
</div>
<div id="test13">
<a href="example.com/testing?ad_domain=" class="js-carousel-item-title">Query param is present, but value is missing.</a>
</div>
<div id="test14">
<a href="git://testing.com/testrepo">Non-standard URL scheme.</a>
</div>
</div>
</body>
</html>
|