Uses 64664K of libraries. Click here for Pure Java version (4322L/25K).
1 | static L<WithURL<S>> youTubeSearch_uncached(Browser browser, S query) { |
2 | temp var page = playwrightOpenPage(browser, |
3 | appendParamsToURL("https://www.youtube.com/results", search_query := query)); |
4 | L<ElementHandle> links1 = page.querySelectorAll("a[href]"); |
5 | LPairS links = map(links1, l -> pair(l.getAttribute("href"), l.innerHTML())); |
6 | links = filter(links, l -> startsWith(l.a, "/watch?") && empty(urlParam(l.a, "list"))); |
7 | |
8 | links = mapPairsB htmldecode_dropTagsAndComments_trim(links); |
9 | |
10 | // Filter out weird links |
11 | links = filter(links, l -> !containsNewLine(l.b) && nempty(l.b)); |
12 | |
13 | ret map(links, l -> WithURL("https://www.youtube.com" + l.a, l.b)); |
14 | } |
Began life as a copy of #1032307
download show line numbers debug dex old transpilations
Travelled to 5 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, uelavcdoioby
No comments. add comment
Snippet ID: | #1032313 |
Snippet name: | youTubeSearch_uncached - uses Playwright |
Eternal ID of this version: | #1032313/5 |
Text MD5: | f120520cb20dfb4406ba6165da13aa15 |
Transpilation MD5: | 95b63b4032ed0f0e9b45ab99ca9d4877 |
Author: | stefan |
Category: | javax / networking |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-08-30 04:30:29 |
Source code size: | 683 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 190 / 249 |
Version history: | 4 change(s) |
Referenced in: | [show references] |