Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to fetch URLs from google #57

Open
aravindb26 opened this issue Sep 25, 2022 · 8 comments
Open

unable to fetch URLs from google #57

aravindb26 opened this issue Sep 25, 2022 · 8 comments

Comments

@aravindb26
Copy link

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
Copy link

xnl-h4ck3r commented Sep 26, 2022

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
Copy link

alanEG commented Dec 27, 2022

@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
Copy link
Author

@xnl-h4ck3r what's this for?

@vanshdevgan
Copy link

vanshdevgan commented Oct 19, 2023

@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
Copy link

Lazerlatel commented Oct 19, 2023 via email

@xnl-h4ck3r
Copy link

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
Copy link

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
Copy link

@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) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants