-
Notifications
You must be signed in to change notification settings - Fork 0
/
ida.internet.html
1721 lines (1611 loc) · 211 KB
/
ida.internet.html
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ida.internet package — IDA 0.01 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="ida.location package" href="ida.location.html" />
<link rel="prev" title="ida.importers package" href="ida.importers.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
IDA
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">ida</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="ida.html">ida package</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="ida.html#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="ida.audiovisual.html">ida.audiovisual package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.casemanager.html">ida.casemanager package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.core.html">ida.core package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.datasets.html">ida.datasets package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.exporters.html">ida.exporters package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.importers.html">ida.importers package</a></li>
<li class="toctree-l4 current"><a class="current reference internal" href="#">ida.internet package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.location.html">ida.location package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.modelling.html">ida.modelling package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.networks.html">ida.networks package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.socmed.html">ida.socmed package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.text.html">ida.text package</a></li>
<li class="toctree-l4"><a class="reference internal" href="ida.visualisation.html">ida.visualisation package</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="ida.html#submodules">Submodules</a></li>
<li class="toctree-l3"><a class="reference internal" href="ida.html#ida-devtools-module">ida.devtools module</a></li>
<li class="toctree-l3"><a class="reference internal" href="ida.html#module-ida">Module contents</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">IDA</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="modules.html">ida</a></li>
<li class="breadcrumb-item"><a href="ida.html">ida package</a></li>
<li class="breadcrumb-item active">ida.internet package</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/ida.internet.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="ida-internet-package">
<h1>ida.internet package<a class="headerlink" href="#ida-internet-package" title="Permalink to this heading"></a></h1>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this heading"></a></h2>
</section>
<section id="module-ida.internet.archives">
<span id="ida-internet-archives-module"></span><h2>ida.internet.archives module<a class="headerlink" href="#module-ida.internet.archives" title="Permalink to this heading"></a></h2>
<p>Functions for interacting with web archives.</p>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.archives.fetch_common_crawl_record">
<span class="sig-prename descclassname"><span class="pre">ida.internet.archives.</span></span><span class="sig-name descname"><span class="pre">fetch_common_crawl_record</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">index_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'CC-MAIN-2023-40'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/archives.html#fetch_common_crawl_record"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.archives.fetch_common_crawl_record" title="Permalink to this definition"></a></dt>
<dd><p>Fetches Common Crawl records for URL.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – url to fetch</p></li>
<li><p><strong>index_name</strong> (<em>str</em>) – the Common Crawl index you want to query
<a href="#id1"><span class="problematic" id="id2">**</span></a>* Replace this with the latest index name</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.archives.fetch_page_from_cc">
<span class="sig-prename descclassname"><span class="pre">ida.internet.archives.</span></span><span class="sig-name descname"><span class="pre">fetch_page_from_cc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">records</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/archives.html#fetch_page_from_cc"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.archives.fetch_page_from_cc" title="Permalink to this definition"></a></dt>
<dd><p>Fetches Common Crawl records.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.archives.open_internet_archive">
<span class="sig-prename descclassname"><span class="pre">ida.internet.archives.</span></span><span class="sig-name descname"><span class="pre">open_internet_archive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">precise_date</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">date_range</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">get</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'first'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">open_index</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/archives.html#open_internet_archive"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.archives.open_internet_archive" title="Permalink to this definition"></a></dt>
<dd><p>Opens Internet Archive search for a URL in default browser.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – URL of archive to open. Defaults to requesting from user input.</p></li>
<li><p><strong>precise_date</strong> (<em>str</em><em>, </em><em>datetime</em><em>, or </em><em>None</em>) – a specific date to retrieve archive results from. If None, this is ignored. Defaults to None.</p></li>
<li><p><strong>date_range</strong> (<em>str</em><em> or </em><em>None</em>) – range of archive dates to open.</p></li>
<li><p><strong>get</strong> (<em>str</em>) – whether to return the first archive result or all results. Defaults to ‘all’.</p></li>
<li><p><strong>open_index</strong> (<em>int</em>) – index of result to open. Defaults to 0.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.archives.search_archiveis">
<span class="sig-prename descclassname"><span class="pre">ida.internet.archives.</span></span><span class="sig-name descname"><span class="pre">search_archiveis</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'request_input'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/archives.html#search_archiveis"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.archives.search_archiveis" title="Permalink to this definition"></a></dt>
<dd><p>Opens an ArchiveIs search for a URL using the default web browser.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.archives.search_cc_index">
<span class="sig-prename descclassname"><span class="pre">ida.internet.archives.</span></span><span class="sig-name descname"><span class="pre">search_cc_index</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">index_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'CC-MAIN-2023-40'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/archives.html#search_cc_index"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.archives.search_cc_index" title="Permalink to this definition"></a></dt>
<dd><p>Searches the Common Crawl’s index for a URL.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – URL to search. Defaults to requesting from user input.</p></li>
<li><p><strong>index_name</strong> (<em>str</em>) – the Common Crawl index you want to query.
<a href="#id3"><span class="problematic" id="id4">**</span></a>* Replace this with the latest index name</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.archives.search_common_crawl">
<span class="sig-prename descclassname"><span class="pre">ida.internet.archives.</span></span><span class="sig-name descname"><span class="pre">search_common_crawl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">threads</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/archives.html#search_common_crawl"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.archives.search_common_crawl" title="Permalink to this definition"></a></dt>
<dd><p>Searches the Common Crawl for a URL.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – URL to search. Defaults to requesting from user input.</p></li>
<li><p><strong>threads</strong> (<em>int</em>) – how many threads to use.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.archives.search_internet_archive">
<span class="sig-prename descclassname"><span class="pre">ida.internet.archives.</span></span><span class="sig-name descname"><span class="pre">search_internet_archive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">get</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'all'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">from_datetime</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">to_datetime</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filter_field</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_metadata</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/archives.html#search_internet_archive"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.archives.search_internet_archive" title="Permalink to this definition"></a></dt>
<dd><p>Searches the Internet Archive for a URL.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – URL to search. Defaults to requesting from user input.</p></li>
<li><p><strong>get</strong> (<em>str</em>) – whether to return the first archive result or all results. Defaults to ‘all’.</p></li>
<li><p><strong>from_datetime</strong> (<em>str</em><em> or </em><em>None</em>) – earliest date to search from. Defaults to None.</p></li>
<li><p><strong>to_datetime</strong> (<em>str</em><em> or </em><em>None</em>) – last date to search until. Defaults to None.</p></li>
<li><p><strong>filter_field</strong> (<em>str</em>) – the field to return.</p></li>
<li><p><strong>output_metadata</strong> (<em>bool</em>) – whether to output archive metdata.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</section>
<section id="module-ida.internet.crawlers">
<span id="ida-internet-crawlers-module"></span><h2>ida.internet.crawlers module<a class="headerlink" href="#module-ida.internet.crawlers" title="Permalink to this heading"></a></h2>
<p>Functions for crawling web data</p>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.append_domain">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">append_domain</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#append_domain"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.append_domain" title="Permalink to this definition"></a></dt>
<dd><p>Appends domain to the start of a URL.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – URL to append domain to</p></li>
<li><p><strong>domain</strong> (<em>str</em>) – domain to append.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – the fixed URL.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.check_bad_url">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">check_bad_url</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#check_bad_url"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.check_bad_url" title="Permalink to this definition"></a></dt>
<dd><p>Checks if URL leads to a real website.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>url</strong> (<em>str</em>) – URL to check. Defaults to requesting from user input.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – whether the URL is a bad link (True == bad).</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.check_crawl_permission">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">check_crawl_permission</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#check_crawl_permission"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.check_crawl_permission" title="Permalink to this definition"></a></dt>
<dd><p>Checks if web crawler has permission to crawl website.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>url</strong> (<em>str</em>) – URL to check. Defaults to requesting from user input.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – whether the URL allows for crawlers.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.clean_seed_urls">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">clean_seed_urls</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seed_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">list</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#clean_seed_urls"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.clean_seed_urls" title="Permalink to this definition"></a></dt>
<dd><p>Cleans list of seed URLs. To be used by web crawler.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>seed_urls</strong> (<em>list</em>) – list containing seed URLs.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>seed_urls</strong> – List of cleaned seed urls.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.compare_sites">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">compare_sites</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">crawl_df</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">DataFrame</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#compare_sites"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.compare_sites" title="Permalink to this definition"></a></dt>
<dd><p>Runs comparative analysis on web crawler results. Compares every combination of the sites provided.</p>
<p>WARNING: can be slow if crawl is large.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>crawl_df</strong> (<em>pandas.DataFrame</em>) – web crawler output to be analysed.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>output_df</strong> – dataframe of comparisons.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>pandas.DataFrame</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>title_distance : float Levenshtein distance between titles (0 if identical).</p></li>
<li><p>author_distance : float Levenshtein distance between author names (0 if identical).</p></li>
<li><p>hostname_distance : float Levenshtein distance between hostnames (0 if identical).</p></li>
<li><p>same_domain : bool whether sites share the same domain (True/False).</p></li>
<li><p>domain_distance : float Levenshtein distance between domains (0 if identical).</p></li>
<li><p>shared_links : set links shared by both sites.</p></li>
<li><p>date_difference (timedelta): time difference between site date entries.</p></li>
<li><p>same_language : bool whether sites share the same language (True/False).</p></li>
<li><p>domain_distance : float Levenshtein distance between domains (0 if identical).</p></li>
<li><p>fingerprint_distance : float Levenshtein distance between site fingerprints (0 if identical).</p></li>
<li><p>id_distance : float Levenshtein distance between site IDs (0 if identical).</p></li>
<li><p>license_distance : float Levenshtein distance between licenses (0 if identical).</p></li>
<li><p>comments_distance : float Levenshtein distance between comments (0 if identical).</p></li>
<li><p>raw_text_distance : float Levenshtein distance between raw texts (0 if identical).</p></li>
<li><p>raw_text_cosine : float Cosine similarity by word count of raw texts (1 if identical).</p></li>
<li><p>text_distance : float Levenshtein distance between parsed texts (0 if identical).</p></li>
<li><p>text_cosine : float Cosine similarity by word count of parsed texts (1 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source names (0 if identical).</p></li>
<li><p>source-hostname_distance : float Levenshtein distance between source-hostname names (0 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source code (0 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source code (0 if identical).</p></li>
<li><p>excerpt_distance : float Levenshtein distance between excerpts (0 if identical).</p></li>
<li><p>excerpt_cosine : float Cosine similarity by word count of excerpts (1 if identical).</p></li>
<li><p>shared_categories : set category tags shared by both sites.</p></li>
<li><p>shared_tags : set tags shared by both sites.</p></li>
<li><p>html_distance : float Levenshtein distance between HTML source codes (0 if identical).</p></li>
<li><p>description_distance : float Levenshtein distance between descriptions (0 if identical).</p></li>
<li><p>description_cosine : float Cosine similarity by word count of descriptions (1 if identical).</p></li>
<li><p>sitename_distance : float Levenshtein distance between sitenames (0 if identical).</p></li>
</ul>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.correct_link_errors">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">correct_link_errors</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">source_domain</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#correct_link_errors"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.correct_link_errors" title="Permalink to this definition"></a></dt>
<dd><p>Checks for errors in a link and corrects them. Returns a corrected link as a string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – URL to correct.</p></li>
<li><p><strong>source_domain</strong> (<em>str</em>) – the domain or URL where the link was found.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>url</strong> – a corrected URL.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.correct_seed_errors">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">correct_seed_errors</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#correct_seed_errors"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.correct_seed_errors" title="Permalink to this definition"></a></dt>
<dd><p>Checks for and corrects errors in a URL to be used as a crawler seed. Returns a corrected link as a string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>url</strong> (<em>str</em>) – URL to correct.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>url</strong> – a corrected URL.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.crawl_from_search">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">crawl_from_search</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">visit_limit</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_domains</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">be_polite</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">full</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_as</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'dataframe'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/crawlers.html#crawl_from_search"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.crawl_from_search" title="Permalink to this definition"></a></dt>
<dd><p>Crawls internet from a web search.</p>
<p>Returns details like links found, HTML scraped, and site metadata.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>query</strong> (<em>str</em>) – query to search.</p></li>
<li><p><strong>visit_limit</strong> (<em>int</em>) – how many URLs the crawler should visit before it stops.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings; link will be ignored if it contains any string in list.</p></li>
<li><p><strong>required_keywords</strong> (<em>list</em>) – list of keywords which sites must contain to be crawled.</p></li>
<li><p><strong>excluded_keywords</strong> (<em>list</em>) – list of keywords which sites must <em>not</em> contain to be crawled.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether or not to ignore string characters’ case.</p></li>
<li><p><strong>ignore_urls</strong> (<em>list</em>) – list of URLs to ignore.</p></li>
<li><p><strong>ignore_domains</strong> (<em>list</em>) – list of domains to ignore.</p></li>
<li><p><strong>be_polite</strong> (<em>bool</em>) – whether respect websites’ permissions for crawlers.</p></li>
<li><p><strong>full</strong> (<em>bool</em>) – whether to run a full scrape on each site. This takes longer.</p></li>
<li><p><strong>output_as</strong> (<em>str</em>) – the format to output results in. Defaults to a pandas.DataFrame.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – an object containing the results of a crawl.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>object</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.crawl_site">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">crawl_site</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_seen_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">10</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_known_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">100000</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">list</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#crawl_site"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.crawl_site" title="Permalink to this definition"></a></dt>
<dd><p>Crawls website’s internal pages. Returns any links found as a list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – URL of the website to crawl.</p></li>
<li><p><strong>max_seen_urls</strong> (<em>int</em>) – the number of pages the crawler is allowed to see before stopping.</p></li>
<li><p><strong>max_known_urls</strong> (<em>int</em>) – the number of URLs the crawler is allowed to find before stopping.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – a list of URLs found.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.crawl_web">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">crawl_web</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seed_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">visit_limit</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">bool</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">bool</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_domains</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">be_polite</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">full</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_as</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'dataframe'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/crawlers.html#crawl_web"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.crawl_web" title="Permalink to this definition"></a></dt>
<dd><p>Crawls internet from a single URL or list of URLs. Returns details like links found, HTML scraped, and site metadata.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>seed_urls</strong> (<em>str</em><em> or </em><em>list</em>) – one or more URLs from which to crawl.</p></li>
<li><p><strong>visit_limit</strong> (<em>int</em>) – how many URLs the crawler should visit before it stops.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings; link will be ignored if it contains any string in list.</p></li>
<li><p><strong>required_keywords</strong> (<em>list</em>) – list of keywords which sites must contain to be crawled.</p></li>
<li><p><strong>excluded_keywords</strong> (<em>list</em>) – list of keywords which sites must <em>not</em> contain to be crawled.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether or not to ignore string characters’ case.</p></li>
<li><p><strong>ignore_urls</strong> (<em>list</em>) – list of URLs to ignore.</p></li>
<li><p><strong>ignore_domains</strong> (<em>list</em>) – list of domains to ignore.</p></li>
<li><p><strong>be_polite</strong> (<em>bool</em>) – whether respect websites’ permissions for crawlers.</p></li>
<li><p><strong>full</strong> (<em>bool</em>) – whether to run a full scrape on each site. This takes longer.</p></li>
<li><p><strong>output_as</strong> (<em>str</em>) – the format to output results in. Defaults to a pandas.DataFrame.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – an object containing the results of a crawl.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>object</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.crawler">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">crawler</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seed_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">visit_limit</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">bool</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">bool</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_domains</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">be_polite</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">full</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_as</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'dataframe'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/crawlers.html#crawler"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.crawler" title="Permalink to this definition"></a></dt>
<dd><p>General purpose web crawler. Crawls from a single URL or list of URLs.</p>
<p>The crawler iterates through queue of URLS; runs checks to see if should proceed with scraping;
if so, scrapes them and adds links found to queue.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>seed_urls</strong> (<em>str</em><em> or </em><em>list</em>) – one or more URLs from which to crawl.</p></li>
<li><p><strong>visit_limit</strong> (<em>int</em>) – how many URLs the crawler should visit before it stops.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings; link will be ignored if it contains any string in list.</p></li>
<li><p><strong>required_keywords</strong> (<em>list</em>) – list of keywords which sites must contain to be crawled.</p></li>
<li><p><strong>excluded_keywords</strong> (<em>list</em>) – list of keywords which sites must <em>not</em> contain to be crawled.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether or not to ignore string characters’ case.</p></li>
<li><p><strong>ignore_urls</strong> (<em>list</em>) – list of URLs to ignore.</p></li>
<li><p><strong>ignore_domains</strong> (<em>list</em>) – list of domains to ignore.</p></li>
<li><p><strong>be_polite</strong> (<em>bool</em>) – whether respect websites’ permissions for crawlers.</p></li>
<li><p><strong>full</strong> (<em>bool</em>) – whether to run a full scrape on each site. This takes longer.</p></li>
<li><p><strong>output_as</strong> (<em>str</em>) – the format to output results in. Defaults to a pandas.DataFrame.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – an object containing the results of a crawl.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>object</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.crawler_engine">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">crawler_engine</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">urls</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_keywords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_keywords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">visit_limit</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_urls</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">be_polite</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">full</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/crawlers.html#crawler_engine"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.crawler_engine" title="Permalink to this definition"></a></dt>
<dd><p>Core functionality for web crawler. Takes inputted URLs, scrapes them, and returns a dictionary of results.</p>
<p>Iterates through queue of URLS; runs checks to see if should proceed with scraping;
if so, scrapes them and adds links found to queue.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>urls</strong> (<em>queue</em>) – ordered queue of URLs to be crawled.</p></li>
<li><p><strong>required_keywords</strong> (<em>list</em>) – list of keywords which sites must contain to be crawled.</p></li>
<li><p><strong>excluded_keywords</strong> (<em>list</em>) – list of keywords which sites must <em>not</em> contain to be crawled.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings; link will be ignored if it contains any string in list.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether or not to ignore string characters’ case.</p></li>
<li><p><strong>visit_limit</strong> (<em>int</em>) – how many URLs the crawler should visit before it stops.</p></li>
<li><p><strong>ignore_urls</strong> (<em>list</em>) – list of URLs to ignore.</p></li>
<li><p><strong>ignore_domains</strong> (<em>list</em>) – list of domains to ignore.</p></li>
<li><p><strong>be_polite</strong> (<em>bool</em>) – whether to respect websites’ permissions for crawlers.</p></li>
<li><p><strong>full</strong> (<em>bool</em>) – whether to run a full scrape on each site. This takes longer.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>output_dict</strong> – a dictionary containing results from each crawled site.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.excluded_keywords_test">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">excluded_keywords_test</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_keywords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/crawlers.html#excluded_keywords_test"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.excluded_keywords_test" title="Permalink to this definition"></a></dt>
<dd><p>Checks if text contains a set of excluded keywords. Returns True if it does not. To be used by web crawler.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (<em>str</em>) – text to check.</p></li>
<li><p><strong>excluded_keywords</strong> (<em>list</em>) – list of strings to check for.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether to be case sensitive when checking for terms.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – True if the text contains a term in excluded_keywords list.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.excluded_term_test">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">excluded_term_test</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">current_url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#excluded_term_test"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.excluded_term_test" title="Permalink to this definition"></a></dt>
<dd><p>Checks if URL contains terms to be excluded. To be used by web crawler.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>current_url</strong> (<em>str</em>) – link to check.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings to check for.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether to be case sensitive when checking for terms.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – True if the URL contains a term in excluded_url_terms list.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.fetch_feed_urls">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">fetch_feed_urls</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">list</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#fetch_feed_urls"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.fetch_feed_urls" title="Permalink to this definition"></a></dt>
<dd><p>Retrieves URLs from web feed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>url</strong> (<em>str</em>) – URL to fetch from. Defaults to requesting from user input.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – web feed result as a list.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.fetch_sitemap">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">fetch_sitemap</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">list</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#fetch_sitemap"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.fetch_sitemap" title="Permalink to this definition"></a></dt>
<dd><p>Retrieves website sitemap. Returns a list of URLs in sitemap.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>url</strong> (<em>str</em>) – URL to fetch from. Defaults to requesting from user input.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – sitemap as a list of URLs.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.fetch_url_rules">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">fetch_url_rules</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'request_input'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/crawlers.html#fetch_url_rules"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.fetch_url_rules" title="Permalink to this definition"></a></dt>
<dd><p>Retrieves website’s rules for robots from robots.txt.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>url</strong> (<em>str</em>) – URL to fetch from. Defaults to requesting from user input.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – Robots.txt ruleset.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>object</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.is_external_link">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">is_external_link</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">source_url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">linked_url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_suffix</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#is_external_link"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.is_external_link" title="Permalink to this definition"></a></dt>
<dd><p>Checks if provided link directs to a URL which is external to a source’s website.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>source_url</strong> (<em>str</em>) – URL to check. Defaults to requesting from user input.</p></li>
<li><p><strong>linked_url</strong> (<em>str</em>) – link to check. Defaults to requesting from user input.</p></li>
<li><p><strong>ignore_suffix</strong> (<em>bool</em>) – whether to ignore the site’s suffix. Defaults to False.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – whether the link is internal or not.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.network_from_crawl">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">network_from_crawl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seed_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">visit_limit</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_domains</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">be_polite</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">full</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_as</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'dataframe'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">Graph</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#network_from_crawl"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.network_from_crawl" title="Permalink to this definition"></a></dt>
<dd><p>Runs web crawl from one or more seed URLS and generates a directed network from the results.</p>
<p>Crawled URLs become vertices; links between URLS become directed edges.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>seed_urls</strong> (<em>str</em><em> or </em><em>list</em>) – one or more URLs from which to crawl.</p></li>
<li><p><strong>visit_limit</strong> (<em>int</em>) – how many URLs the crawler should visit before it stops.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings; link will be ignored if it contains any string in list.</p></li>
<li><p><strong>required_keywords</strong> (<em>list</em>) – list of keywords which sites must contain to be crawled.</p></li>
<li><p><strong>excluded_keywords</strong> (<em>list</em>) – list of keywords which sites must <em>not</em> contain to be crawled.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether or not to ignore string characters’ case.</p></li>
<li><p><strong>ignore_urls</strong> (<em>list</em>) – list of URLs to ignore.</p></li>
<li><p><strong>ignore_domains</strong> (<em>list</em>) – list of domains to ignore.</p></li>
<li><p><strong>be_polite</strong> (<em>bool</em>) – whether respect websites’ permissions for crawlers.</p></li>
<li><p><strong>full</strong> (<em>bool</em>) – whether to run a full scrape on each site. This takes longer.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>network</strong> – a network representing the results of a web crawl.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>igraph.Graph</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.network_from_crawl_result">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">network_from_crawl_result</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">crawl_df</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">Graph</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#network_from_crawl_result"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.network_from_crawl_result" title="Permalink to this definition"></a></dt>
<dd><p>Takes web crawler output and returns a network object.</p>
<p>Crawled URLs become vertices; links between URLS become directed edges.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>crawl_df</strong> (<em>pandas.DataFrame</em>) – web crawler output to be converted to network.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>network</strong> – a network representing the results of a web crawl.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>igraph.Graph</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.network_from_search_crawl">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">network_from_search_crawl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">visit_limit</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_domains</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">be_polite</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">full</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_as</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'dataframe'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">Graph</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#network_from_search_crawl"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.network_from_search_crawl" title="Permalink to this definition"></a></dt>
<dd><p>Runs web crawl from search and generates a directed network from the results.</p>
<p>Crawled URLs become vertices; links between URLS become directed edges.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>query</strong> (<em>str</em>) – query to search.</p></li>
<li><p><strong>visit_limit</strong> (<em>int</em>) – how many URLs the crawler should visit before it stops.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings; link will be ignored if it contains any string in list.</p></li>
<li><p><strong>required_keywords</strong> (<em>list</em>) – list of keywords which sites must contain to be crawled.</p></li>
<li><p><strong>excluded_keywords</strong> (<em>list</em>) – list of keywords which sites must <em>not</em> contain to be crawled.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether or not to ignore string characters’ case.</p></li>
<li><p><strong>ignore_urls</strong> (<em>list</em>) – list of URLs to ignore.</p></li>
<li><p><strong>ignore_domains</strong> (<em>list</em>) – list of domains to ignore.</p></li>
<li><p><strong>be_polite</strong> (<em>bool</em>) – whether respect websites’ permissions for crawlers.</p></li>
<li><p><strong>full</strong> (<em>bool</em>) – whether to run a full scrape on each site. This takes longer.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>network</strong> – a network representing the results of a web crawl.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>igraph.Graph</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.required_keywords_test">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">required_keywords_test</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_keywords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/ida/internet/crawlers.html#required_keywords_test"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.required_keywords_test" title="Permalink to this definition"></a></dt>
<dd><p>Checks if text contains a set of required keywords. Returns True if it does. To be used by web crawler.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (<em>str</em>) – text to check.</p></li>
<li><p><strong>required_keywords</strong> (<em>list</em>) – list of strings to check for.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether to be case sensitive when checking for terms.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – True if the text contains a term in required_keywords list.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.seed_str_to_list">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">seed_str_to_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seed_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">list</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#seed_str_to_list"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.seed_str_to_list" title="Permalink to this definition"></a></dt>
<dd><p>Takes a string of seed URLs in list format and returns a list object. To be used by web crawler.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>seed_urls</strong> (<em>str</em>) – string containing seed URLs.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>seed_urls</strong> – List of seed urls.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.select_crawled_links">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">select_crawled_links</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">iteration:</span> <span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">source_domain:</span> <span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">link_elements</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">urls:</span> <span class="pre"><module</span> <span class="pre">'queue'</span> <span class="pre">from</span> <span class="pre">'/usr/local/anaconda3/lib/python3.9/queue.py'></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">visited_urls:</span> <span class="pre">list</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_urls:</span> <span class="pre">list</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_domains:</span> <span class="pre">list</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms:</span> <span class="pre">list</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">tuple</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#select_crawled_links"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.select_crawled_links" title="Permalink to this definition"></a></dt>
<dd><p>Selects links to crawl from set of crawler scraper results. To be used by web crawler. Returns a tuple containing links and URLs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>iteration</strong> (<em>int</em>) – how many iterations the crawler engine has run.</p></li>
<li><p><strong>source_domain</strong> (<em>str</em>) – domain of URL currently being crawled.</p></li>
<li><p><strong>link_elements</strong> (<em>list</em>) – iterable containing URL’s links as HTML elements.</p></li>
<li><p><strong>urls</strong> (<em>queue</em>) – ordered queue of URLs to be crawled.</p></li>
<li><p><strong>visited_urls</strong> (<em>list</em>) – list of URLs already visited.</p></li>
<li><p><strong>ignore_urls</strong> (<em>list</em>) – list of URLs to ignore.</p></li>
<li><p><strong>ignore_domains</strong> – list list of domains to ignore.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings; link will be ignored if it contains any string in list.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>result</strong> – a tuple containing the updated URLs queue and any new links found.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.similarity_network_from_crawl">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">similarity_network_from_crawl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seed_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">measure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'html_distance'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">visit_limit</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_domains</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">be_polite</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">full</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">Graph</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#similarity_network_from_crawl"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.similarity_network_from_crawl" title="Permalink to this definition"></a></dt>
<dd><p>Runs web crawl, compares sites found, and returns a weighted network representing those sites’ similarities.</p>
<p>Crawled URLs become vertices; similarity measures between URLs become undirected edges.
Edge weights correspond to a chosen similarity measure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>seed_urls</strong> (<em>str</em><em> or </em><em>list</em>) – one or more URLs from which to crawl.</p></li>
<li><p><strong>measure</strong> (<em>str</em>) – similarity measure to use as edge weight.</p></li>
<li><p><strong>visit_limit</strong> (<em>int</em>) – how many URLs the crawler should visit before it stops.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings; link will be ignored if it contains any string in list.</p></li>
<li><p><strong>required_keywords</strong> (<em>list</em>) – list of keywords which sites must contain to be crawled.</p></li>
<li><p><strong>excluded_keywords</strong> (<em>list</em>) – list of keywords which sites must <em>not</em> contain to be crawled.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether or not to ignore string characters’ case.</p></li>
<li><p><strong>ignore_urls</strong> (<em>list</em>) – list of URLs to ignore.</p></li>
<li><p><strong>ignore_domains</strong> (<em>list</em>) – list of domains to ignore.</p></li>
<li><p><strong>be_polite</strong> (<em>bool</em>) – whether respect websites’ permissions for crawlers.</p></li>
<li><p><strong>full</strong> (<em>bool</em>) – whether to run a full scrape on each site. This takes longer.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>network</strong> – a weighted, undirected, complete network representing the site comparisons.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>igraph.Graph</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<dl class="simple">
<dt>Options for ‘measure’ (defaults to ‘html_distance’):</dt><dd><ul class="simple">
<li><p>title_distance : float Levenshtein distance between titles (0 if identical).</p></li>
<li><p>author_distance : float Levenshtein distance between author names (0 if identical).</p></li>
<li><p>hostname_distance : float Levenshtein distance between hostnames (0 if identical).</p></li>
<li><p>same_domain : bool whether sites share the same domain (True/False).</p></li>
<li><p>domain_distance : float Levenshtein distance between domains (0 if identical).</p></li>
<li><p>shared_links : set links shared by both sites.</p></li>
<li><p>date_difference (timedelta): time difference between site date entries.</p></li>
<li><p>same_language : bool whether sites share the same language (True/False).</p></li>
<li><p>domain_distance : float Levenshtein distance between domains (0 if identical).</p></li>
<li><p>fingerprint_distance : float Levenshtein distance between site fingerprints (0 if identical).</p></li>
<li><p>id_distance : float Levenshtein distance between site IDs (0 if identical).</p></li>
<li><p>license_distance : float Levenshtein distance between licenses (0 if identical).</p></li>
<li><p>comments_distance : float Levenshtein distance between comments (0 if identical).</p></li>
<li><p>raw_text_distance : float Levenshtein distance between raw texts (0 if identical).</p></li>
<li><p>raw_text_cosine : float Cosine similarity by word count of raw texts (1 if identical).</p></li>
<li><p>text_distance : float Levenshtein distance between parsed texts (0 if identical).</p></li>
<li><p>text_cosine : float Cosine similarity by word count of parsed texts (1 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source names (0 if identical).</p></li>
<li><p>source-hostname_distance : float Levenshtein distance between source-hostname names (0 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source code (0 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source code (0 if identical).</p></li>
<li><p>excerpt_distance : float Levenshtein distance between excerpts (0 if identical).</p></li>
<li><p>excerpt_cosine : float Cosine similarity by word count of excerpts (1 if identical).</p></li>
<li><p>shared_categories : set category tags shared by both sites.</p></li>
<li><p>shared_tags : set tags shared by both sites.</p></li>
<li><p>html_distance : float Levenshtein distance between HTML source codes (0 if identical).</p></li>
<li><p>description_distance : float Levenshtein distance between descriptions (0 if identical).</p></li>
<li><p>description_cosine : float Cosine similarity by word count of descriptions (1 if identical).</p></li>
<li><p>sitename_distance : float Levenshtein distance between sitenames (0 if identical).</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.similarity_network_from_crawl_result">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">similarity_network_from_crawl_result</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">crawl_df</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">measure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'html_distance'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">Graph</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#similarity_network_from_crawl_result"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.similarity_network_from_crawl_result" title="Permalink to this definition"></a></dt>
<dd><p>Takes web crawl result, compares sites found, and returns a weighted network representing those sites’ similarities.</p>
<p>Crawled URLs become vertices; similarity measures between URLs become undirected edges.
Edge weights correspond to a chosen similarity measure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>crawl_df</strong> (<em>pandas.DataFrame</em>) – web crawl result.</p></li>
<li><p><strong>measure</strong> (<em>str</em>) – similarity measure to use as edge weight.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>network</strong> – a weighted, undirected, complete network representing the site comparisons.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>igraph.Graph</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<dl class="simple">
<dt>Options for ‘measure’ (defaults to ‘html_distance’):</dt><dd><ul class="simple">
<li><p>title_distance : float Levenshtein distance between titles (0 if identical).</p></li>
<li><p>author_distance : float Levenshtein distance between author names (0 if identical).</p></li>
<li><p>hostname_distance : float Levenshtein distance between hostnames (0 if identical).</p></li>
<li><p>same_domain : bool whether sites share the same domain (True/False).</p></li>
<li><p>domain_distance : float Levenshtein distance between domains (0 if identical).</p></li>
<li><p>shared_links : set links shared by both sites.</p></li>
<li><p>date_difference (timedelta): time difference between site date entries.</p></li>
<li><p>same_language : bool whether sites share the same language (True/False).</p></li>
<li><p>domain_distance : float Levenshtein distance between domains (0 if identical).</p></li>
<li><p>fingerprint_distance : float Levenshtein distance between site fingerprints (0 if identical).</p></li>
<li><p>id_distance : float Levenshtein distance between site IDs (0 if identical).</p></li>
<li><p>license_distance : float Levenshtein distance between licenses (0 if identical).</p></li>
<li><p>comments_distance : float Levenshtein distance between comments (0 if identical).</p></li>
<li><p>raw_text_distance : float Levenshtein distance between raw texts (0 if identical).</p></li>
<li><p>raw_text_cosine : float Cosine similarity by word count of raw texts (1 if identical).</p></li>
<li><p>text_distance : float Levenshtein distance between parsed texts (0 if identical).</p></li>
<li><p>text_cosine : float Cosine similarity by word count of parsed texts (1 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source names (0 if identical).</p></li>
<li><p>source-hostname_distance : float Levenshtein distance between source-hostname names (0 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source code (0 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source code (0 if identical).</p></li>
<li><p>excerpt_distance : float Levenshtein distance between excerpts (0 if identical).</p></li>
<li><p>excerpt_cosine : float Cosine similarity by word count of excerpts (1 if identical).</p></li>
<li><p>shared_categories : set category tags shared by both sites.</p></li>
<li><p>shared_tags : set tags shared by both sites.</p></li>
<li><p>html_distance : float Levenshtein distance between HTML source codes (0 if identical).</p></li>
<li><p>description_distance : float Levenshtein distance between descriptions (0 if identical).</p></li>
<li><p>description_cosine : float Cosine similarity by word count of descriptions (1 if identical).</p></li>
<li><p>sitename_distance : float Levenshtein distance between sitenames (0 if identical).</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.similarity_network_from_search_crawl">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">similarity_network_from_search_crawl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">query</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">measure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'html_distance'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">visit_limit</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_domains</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">be_polite</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">full</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_as</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'dataframe'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">Graph</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#similarity_network_from_search_crawl"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.similarity_network_from_search_crawl" title="Permalink to this definition"></a></dt>
<dd><p>Runs web crawl from search, compares sites that are found, and generates an undirected network from the results.</p>
<p>Crawled URLs become vertices; similarity measures between URLs become undirected edges.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>query</strong> (<em>str</em>) – query to search.</p></li>
<li><p><strong>measure</strong> (<em>str</em>) – similarity measure to use as edge weight.</p></li>
<li><p><strong>visit_limit</strong> (<em>int</em>) – how many URLs the crawler should visit before it stops.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings; link will be ignored if it contains any string in list.</p></li>
<li><p><strong>required_keywords</strong> (<em>list</em>) – list of keywords which sites must contain to be crawled.</p></li>
<li><p><strong>excluded_keywords</strong> (<em>list</em>) – list of keywords which sites must <em>not</em> contain to be crawled.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether or not to ignore string characters’ case.</p></li>
<li><p><strong>ignore_urls</strong> (<em>list</em>) – list of URLs to ignore.</p></li>
<li><p><strong>ignore_domains</strong> (<em>list list of domains to ignore.</em>) – </p></li>
<li><p><strong>be_polite</strong> (<em>bool</em>) – whether respect websites’ permissions for crawlers.</p></li>
<li><p><strong>full</strong> (<em>bool</em>) – whether to run a full scrape on each site. This takes longer.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>network</strong> – a network representing the results of site comparison analysis.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>igraph.Graph</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<dl class="simple">
<dt>Options for ‘measure’ (defaults to ‘html_distance’):</dt><dd><ul class="simple">
<li><p>title_distance : float Levenshtein distance between titles (0 if identical).</p></li>
<li><p>author_distance : float Levenshtein distance between author names (0 if identical).</p></li>
<li><p>hostname_distance : float Levenshtein distance between hostnames (0 if identical).</p></li>
<li><p>same_domain : bool whether sites share the same domain (True/False).</p></li>
<li><p>domain_distance : float Levenshtein distance between domains (0 if identical).</p></li>
<li><p>shared_links : set links shared by both sites.</p></li>
<li><p>date_difference (timedelta): time difference between site date entries.</p></li>
<li><p>same_language : bool whether sites share the same language (True/False).</p></li>
<li><p>domain_distance : float Levenshtein distance between domains (0 if identical).</p></li>
<li><p>fingerprint_distance : float Levenshtein distance between site fingerprints (0 if identical).</p></li>
<li><p>id_distance : float Levenshtein distance between site IDs (0 if identical).</p></li>
<li><p>license_distance : float Levenshtein distance between licenses (0 if identical).</p></li>
<li><p>comments_distance : float Levenshtein distance between comments (0 if identical).</p></li>
<li><p>raw_text_distance : float Levenshtein distance between raw texts (0 if identical).</p></li>
<li><p>raw_text_cosine : float Cosine similarity by word count of raw texts (1 if identical).</p></li>
<li><p>text_distance : float Levenshtein distance between parsed texts (0 if identical).</p></li>
<li><p>text_cosine : float Cosine similarity by word count of parsed texts (1 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source names (0 if identical).</p></li>
<li><p>source-hostname_distance : float Levenshtein distance between source-hostname names (0 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source code (0 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source code (0 if identical).</p></li>
<li><p>excerpt_distance : float Levenshtein distance between excerpts (0 if identical).</p></li>
<li><p>excerpt_cosine : float Cosine similarity by word count of excerpts (1 if identical).</p></li>
<li><p>shared_categories : set category tags shared by both sites.</p></li>
<li><p>shared_tags : set tags shared by both sites.</p></li>
<li><p>html_distance : float Levenshtein distance between HTML source codes (0 if identical).</p></li>
<li><p>description_distance : float Levenshtein distance between descriptions (0 if identical).</p></li>
<li><p>description_cosine : float Cosine similarity by word count of descriptions (1 if identical).</p></li>
<li><p>sitename_distance : float Levenshtein distance between sitenames (0 if identical).</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="ida.internet.crawlers.site_similarities_from_crawl">
<span class="sig-prename descclassname"><span class="pre">ida.internet.crawlers.</span></span><span class="sig-name descname"><span class="pre">site_similarities_from_crawl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seed_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'request_input'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">measure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'html_distance'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">visit_limit</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_url_terms</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excluded_keywords</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">case_sensitive</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_urls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">list</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ignore_domains</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'default'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">be_polite</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">full</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">DataFrame</span></span></span><a class="reference internal" href="_modules/ida/internet/crawlers.html#site_similarities_from_crawl"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#ida.internet.crawlers.site_similarities_from_crawl" title="Permalink to this definition"></a></dt>
<dd><p>Runs web crawl from seed URL or URls, then runs a comparative analysis on results. Compares every combination of site crawled.</p>
<p>WARNING: can be slow if crawl is large.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>seed_urls</strong> (<em>str</em><em> or </em><em>list</em>) – one or more URLs from which to crawl.</p></li>
<li><p><strong>visit_limit</strong> (<em>int</em>) – how many URLs the crawler should visit before it stops.</p></li>
<li><p><strong>excluded_url_terms</strong> (<em>list</em>) – list of strings; link will be ignored if it contains any string in list.</p></li>
<li><p><strong>required_keywords</strong> (<em>list</em>) – list of keywords which sites must contain to be crawled.</p></li>
<li><p><strong>excluded_keywords</strong> (<em>list</em>) – list of keywords which sites must <em>not</em> contain to be crawled.</p></li>
<li><p><strong>case_sensitive</strong> (<em>bool</em>) – whether or not to ignore string characters’ case.</p></li>
<li><p><strong>ignore_urls</strong> (<em>list</em>) – list of URLs to ignore.</p></li>
<li><p><strong>ignore_domains</strong> (<em>list</em>) – list of domains to ignore.</p></li>
<li><p><strong>be_polite</strong> (<em>bool</em>) – whether respect websites’ permissions for crawlers.</p></li>
<li><p><strong>full</strong> (<em>bool</em>) – whether to run a full scrape on each site. This takes longer.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>output_df</strong> – dataframe of comparisons.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>pandas.DataFrame</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>title_distance : float Levenshtein distance between titles (0 if identical).</p></li>
<li><p>author_distance : float Levenshtein distance between author names (0 if identical).</p></li>
<li><p>hostname_distance : float Levenshtein distance between hostnames (0 if identical).</p></li>
<li><p>same_domain : bool whether sites share the same domain (True/False).</p></li>
<li><p>domain_distance : float Levenshtein distance between domains (0 if identical).</p></li>
<li><p>shared_links : set links shared by both sites.</p></li>
<li><p>date_difference (timedelta): time difference between site date entries.</p></li>
<li><p>same_language : bool whether sites share the same language (True/False).</p></li>
<li><p>domain_distance : float Levenshtein distance between domains (0 if identical).</p></li>
<li><p>fingerprint_distance : float Levenshtein distance between site fingerprints (0 if identical).</p></li>
<li><p>id_distance : float Levenshtein distance between site IDs (0 if identical).</p></li>
<li><p>license_distance : float Levenshtein distance between licenses (0 if identical).</p></li>
<li><p>comments_distance : float Levenshtein distance between comments (0 if identical).</p></li>
<li><p>raw_text_distance : float Levenshtein distance between raw texts (0 if identical).</p></li>
<li><p>raw_text_cosine : float Cosine similarity by word count of raw texts (1 if identical).</p></li>
<li><p>text_distance : float Levenshtein distance between parsed texts (0 if identical).</p></li>
<li><p>text_cosine : float Cosine similarity by word count of parsed texts (1 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source names (0 if identical).</p></li>
<li><p>source-hostname_distance : float Levenshtein distance between source-hostname names (0 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source code (0 if identical).</p></li>
<li><p>source_distance : float Levenshtein distance between source code (0 if identical).</p></li>
<li><p>excerpt_distance : float Levenshtein distance between excerpts (0 if identical).</p></li>
<li><p>excerpt_cosine : float Cosine similarity by word count of excerpts (1 if identical).</p></li>
<li><p>shared_categories : set category tags shared by both sites.</p></li>
<li><p>shared_tags : set tags shared by both sites.</p></li>
<li><p>html_distance : float Levenshtein distance between HTML source codes (0 if identical).</p></li>
<li><p>description_distance : float Levenshtein distance between descriptions (0 if identical).</p></li>
<li><p>description_cosine : float Cosine similarity by word count of descriptions (1 if identical).</p></li>