-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bd2178
commit be25d8a
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# flake8: noqa | ||
"""this script is used to find all the xpath patterns in the database, so that they can be mapped to new patterns in xpath_mappings.py""" | ||
|
||
from sde_collections.models.pattern import TitlePattern | ||
|
||
print( | ||
"there are", TitlePattern.objects.filter(title_pattern__contains="xpath").count(), "xpath patterns in the database" | ||
) | ||
|
||
# Get all the xpath patterns and their candidate urls | ||
xpath_patterns = TitlePattern.objects.filter(title_pattern__contains="xpath") | ||
for xpath_pattern in xpath_patterns: | ||
print(xpath_pattern.title_pattern) | ||
# for url in xpath_pattern.candidate_urls.all(): | ||
# print(url.url) | ||
print() | ||
|
||
# not every xpath pattern has a candidate url, but I went ahead and fixed all of them anyway |
File renamed without changes.