-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this does not work yet, the lxml doesnt detect the outer-cell divs for some reason
- Loading branch information
Showing
2 changed files
with
72 additions
and
3 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,24 @@ | ||
""" | ||
basic script to parse HTML so its easier to benchmark in isolation | ||
""" | ||
|
||
import sys | ||
from pathlib import Path | ||
from google_takeout_parser.parse_html.activity import _parse_html_activity | ||
|
||
|
||
def main() -> None: | ||
file = Path(sys.argv[1]) | ||
# print file size | ||
print(f"File size: {file.stat().st_size}") | ||
# just consume the whole generator | ||
count = 0 | ||
for event in _parse_html_activity(Path(sys.argv[1]), stream=True): | ||
assert not isinstance(event, Exception) | ||
print(event) | ||
count += 1 | ||
print(f"Number of items: {count}") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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