'How to copy certain urls from a webpage?
I have hundreds of page which I need to grab the urls of certain filehosters, but since the number of link for each page and the pages theyself, it has been tested to find the string and copy to the clipboard , using javascript
static getFileUrl(id){
var url=new URL("https://fileshosting.net/file/FileUrl")
url.searchParams.append('*',id)
return url.href
}
static copyFileUrl(id){
copy(this.getFileUrl(id))
}
I'm not to used to javascript but this should suffice, and everything it gets its the next console output
Uncaught SyntaxError: unexpected token: identifier
I understand this mean a semicolon before the statement is missing. But I don't get where it is. AFAIK there are two statement (the static procedures). And sometimes there is only one url but in other pages there are 20 or 50 urls so perhaps it should be used an array, but I don't know how to implement an array in javascript.
so is there some method to, instead of open manually page to page, parse it from a terminal and pipe it to this (java)script or another language rutine?
Thanks in advance.
UPDATE
I have found another way, since it doesn't work this approach.
Thanks for the support and time.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
