Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Specification Tools
Scripts
Commits
88a85486
Commit
88a85486
authored
1 year ago
by
Miguel Angel Reina Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Debug document list element
parent
6264950d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
updateIndex.py
+7
-1
7 additions, 1 deletion
updateIndex.py
with
7 additions
and
1 deletion
updateIndex.py
+
7
−
1
View file @
88a85486
...
...
@@ -24,14 +24,20 @@ def upgradeIndex(args: argparse.Namespace) -> None:
with
open
(
args
.
indexTemplate
,
'
r
'
,
encoding
=
'
utf-8
'
)
as
dest_file
:
dest_html
=
dest_file
.
read
()
print
(
source_html
)
print
(
dest_html
)
# Parse both HTML files
source_soup
=
BeautifulSoup
(
source_html
,
'
html.parser
'
)
dest_soup
=
BeautifulSoup
(
dest_html
,
'
html.parser
'
)
print
(
source_soup
)
print
(
dest_soup
)
# Find the <ul> element in both the source and destination HTML
source_ul
=
source_soup
.
find
(
'
ul
'
,
id
=
'
document-list
'
)
dest_ul
=
dest_soup
.
find
(
'
ul
'
,
id
=
'
document-list
'
)
print
(
source_ul
)
print
(
dest_ul
)
# Copy the contents of the source <ul> to the destination <ul>
if
dest_ul
and
source_ul
:
dest_ul
.
extend
(
source_ul
.
contents
)
...
...
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