Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AiWebProject1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Rebers
AiWebProject1
Commits
c5e90b30
Commit
c5e90b30
authored
1 year ago
by
srebers
Browse files
Options
Downloads
Patches
Plain Diff
second commit
parent
fc4bbf92
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
crawler.py
+30
-2
30 additions, 2 deletions
crawler.py
indexing.py
+2
-0
2 additions, 0 deletions
indexing.py
with
33 additions
and
2 deletions
.gitignore
0 → 100644
+
1
−
0
View file @
c5e90b30
venv
This diff is collapsed.
Click to expand it.
crawler.py
+
30
−
2
View file @
c5e90b30
from
queue
import
Queue
from
urllib.parse
import
urljoin
import
requests
from
bs4
import
BeautifulSoup
# r = requests.get('https://vm009.rz.uos.de/crawl/index.html')
queue
=
Queue
()
visitedLinks
=
[]
queue
.
put
(
'
https://vm009.rz.uos.de/crawl/index.html
'
)
visitedLinks
.
append
(
'
https://vm009.rz.uos.de/crawl/index.html
'
)
while
not
queue
.
empty
():
link
=
queue
.
get
()
r
=
requests
.
get
(
link
)
soup
=
BeautifulSoup
(
r
.
content
,
'
html.parser
'
)
# print(r.content)
for
l
in
soup
.
find_all
(
"
a
"
):
url
=
urljoin
(
'
https://vm009.rz.uos.de/crawl/
'
,
l
[
'
href
'
])
if
url
not
in
visitedLinks
and
'
https://vm009.rz.uos.de/crawl
'
in
url
:
print
(
url
)
print
(
l
.
text
)
queue
.
put
(
url
)
visitedLinks
.
append
(
url
)
print
(
visitedLinks
)
r
=
requests
.
get
(
'
https://vm009.rz.uos.de/crawl/index.html
'
)
print
(
r
.
content
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
indexing.py
0 → 100644
+
2
−
0
View file @
c5e90b30
from
whoosh.index
import
create_in
from
whoosh.fields
import
*
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment