tomnomnom / hacks

A collection of hacks and one-off scripts
2.13k stars 636 forks source link

unable to fetch URLs from google #57

Open aravindb26 opened 2 years ago

aravindb26 commented 2 years ago

Hi @tomnomnom I did all things in the correct way, still, I'm unable to get URLs from ur extension. Can you guide me on anything?

xnl-h4ck3r commented 2 years ago

Hi @aravindb26. Are you refering to WebPaste? If so, the Google JS has changed, so in webpaste Options, you need to... set Code to: [...document.querySelectorAll('div.yuRUbf>a:first-child')].map(n=>n.href) and set On Success to: document.location=document.querySelectorAll('a#pnnext')[0].href; That should get the URLs from Google for example

alanEG commented 1 year ago

@xnl-h4ck3r Nice work Also you should add the host permission in manifest.json By "permissions": ["storage", "declarativeContent", "activeTab", "tabs","https://*.google.com/*"], Or "permissions": ["storage", "declarativeContent", "activeTab", "tabs","https://*/*"],

aravindb26 commented 1 year ago

@xnl-h4ck3r what's this for?

vanshdevgan commented 1 year ago

@aravindb26 @xnl-h4ck3r you can use this set Code to

[...document.querySelectorAll('a')].map(n => n.href).slice(47, -1).filter(url => !url.includes('.google.com'));

for on Success you can scroll down to end or use autoscroll chrome extension and then click on webpaste to get all urls

Lazerlatel commented 1 year ago

I don't understand.

Pada tanggal Jum, 20 Okt 2023 06.07, Vansh Devgan @.***> menulis:

@aravindb26 https://github.com/aravindb26 @xnl-h4ck3r https://github.com/xnl-h4ck3r you can use this set Code to

[...document.querySelectorAll('a')].map(n => n.href).slice(47, -1).filter(url => !url.includes('.google.com'));

for on Success you can scroll down to end or use autoscroll chrome extension and then click on webpaste to get all urls

— Reply to this email directly, view it on GitHub https://github.com/tomnomnom/hacks/issues/57#issuecomment-1771707555, or unsubscribe https://github.com/notifications/unsubscribe-auth/BADRJEH6V4WHW4NFBN5UIZLYAGJCTAVCNFSM6AAAAAAQVFS6L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRG4YDONJVGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

xnl-h4ck3r commented 1 year ago

Thanks @vanshdevgan, works great! I added a bit to the end to avoid blanks it sometimes gets too [...document.querySelectorAll('a')].map(n => n.href).slice(47, -1).filter(url => !url.includes('.google.com')).filter(url => !url=='');

@Lazerlatel , this is what you enter into the Code (should return an array of strings): for a Google snippet so you can grab URls from google.com

xnl-h4ck3r commented 1 year ago

Thanks @vanshdevgan, works great! I added a bit to the end to avoid blanks it sometimes gets too [...document.querySelectorAll('a')].map(n => n.href).slice(47, -1).filter(url => !url.includes('.google.com')).filter(url => !url=='');

@Lazerlatel , this is what you enter into the Code (should return an array of strings): for a Google snippet so you can grab URls from google.com

Actually, I think this would be better too... [...document.querySelectorAll('a')].map(n => n.href).slice(47, -1).filter(url => !url.includes('.google')).filter(url => !url=='') because it will remove other things like googleusercontent etc. and also work if you use google.co.uk, etc.

xnl-h4ck3r commented 1 year ago

@aravindb26 @xnl-h4ck3r you can use this set Code to

[...document.querySelectorAll('a')].map(n => n.href).slice(47, -1).filter(url => !url.includes('.google.com'));

for on Success you can scroll down to end or use autoscroll chrome extension and then click on webpaste to get all urls

Hi @vanshdevgan. Actually what is the purpose of the .slice(47, -1) ?