Skip to content

Commit

Permalink
Fix: scraping Directory name
Browse files Browse the repository at this point in the history
  • Loading branch information
amasin76 committed Nov 14, 2023
1 parent 6339752 commit 020dee6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pages/content/scrapeFilesNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ function scrapeFileNames(html: string): {
for (let idx = 0; idx < taskCards.length; idx++) {
const taskCard = taskCards[idx];
const fileElement = findElementByText(taskCard, "li", "File:");
const dirElement = findElementByText(taskCard, "li", "Directory:");
dirName = dirElement?.querySelector("code")?.textContent;

// If there is no dirElement, set dirName to the repository name
if (!dirName) {
Expand Down

0 comments on commit 020dee6

Please sign in to comment.