Yes.. sir we all are looking for this type of videos... .. Sir can u start a series for intermediate python learners ... Sir thanks so much. Love u a lot
Sir, I want to ask you a question that is not related to this video, and request you for answer. My question is 'how some website sell windows10 genuine product key for just ₹750-₹1000, while microsoft sell it ₹8K - ₹15K. How can it possible sir? Is this cheap keys are really genuine? How many years this cheap keys can activate the windows?' This is my first comment on youtube, and I hope I'll get the true answer from you. You are the amazing knowledgeable person I've ever seen, that's why I'm asking you. And really sorry if there has been any mistake to write my comment correctly, coz I've very little knowledge about english. And once again I must tell you that you are really amazing.
Hello Hitesh! Thanks for Such a nice Tutorial really informative. I wrote the same code as explained in video but while running the scipts using cmdprompt I am not seeing any webbrowser window opened for me. I tried multiple times. It is not throwing any error while running the script. Please let me know how to resolve this.
I got it correct the syntax of regex expression need to modify to -->linkElements = soup.select(r'a') instead of linkElements = soup.select('.r a') it worked for me.
Your code doesn't give any error but it is not opening the browser. How can I solve this?
4 года назад+19
hiya there, i'm working with windows so whenever i call from my system the code nothing happen what i could, there is not any error, but neither a single browser open.
Sir Is it possible to scrap audio/video files from Google search results. Ex: If i search for a song in Google then, we can scrap all audio files from that results. We don't have to go inside any website. Sir if possible then please make a video in this 🙂
Hi, Thanks for the video. I see this was done in Oct 2018 hency may have worked that time. But now, it doesn't work. Because requests.get() doesn't return complete HTML code. So basically your line no 6 returns empty list. Do you have a solution to overcome this?
Everytime after watching your video the energy and your dedication makes me to work even harder . My android app will hit the play store very soon sir. Thank u Hitesh sir
I started watching your videos when I started learning programming 8 months ago,and this the first technical video of yours that I could understand.😚😁😁
Hi Hitesh, Your video was really helpful. I started python recently and it was really helpful. I have a request it it possible to right those code on Jupyter notebook as I was using Jupyter. I tried this same libraries but they are not working. So if you can help me that would be really helpful. Thank you
searching into comments i foum these, i hope you can use it, for me is worked "vipul garg" Hace 7 meses (editado) I got it correct the syntax of regex expression need to modify to -->linkElements = soup.select(r'a') instead of linkElements = soup.select('.r a') it worked for me.
i ran this on windows using visual studio. it didnt work for me. it said erorn 2=file directory cannot be found. i have changed the path severally but still fails. any way out?
HI, I had same issue, I changed code that way: search_terms = search_terms.replace(' ', '%20') url = 'google.com/search?q='+''.join(search_terms) print(url) res = requests.get(url) But i am having issues getting href links. I am unsure if the css_selector changes from one country to another.
Hi Hitesh, I have multiline text from tkinter UI which is stored in var 'a'. how do i use that var 'a' for searching in google instead of this string i.e. your name? Please revert back with that 1/2 line of code.
linkElement = soup.select('.r a') ----- this line is not opening any pages in browser when i remove (.r) it opens perfectly but i get 2 extra blank google search pages first then the desired result appears....any solutions?
Hello, I tried the same and I got what you said some extra empty tabs So I dig into some concepts and modified the present code The present basics of code working are same we make requests open url using webbrowser library but I saw a pattern that in this link for example www.google.com/ after this part is there is /search?q= part with arguments infront of it as said in video it opens according to arguments but if it is not then it just opens home page of google that is www.google.com www.google.com/search?q=PewDiePie&ie=UTF-8&source=lnms&tbm=shop&sa=X&ved=0ahUKEwja_vjouM3sAhXPXCsKHTKIDkYQ_AUIDCgF So I wrote a code such that it checks if that q tage for arguments is present or not and then proceed to consider it as a link to be opened Here is the code ( Just a try from me anyone could do it better and modify this, and look out for indentations if you are copying this code and trying it in compiler) import requests, sys, webbrowser, bs4 def search(text) : linkElements = [] linkToOpen = [] i = 0
Sir....i am working as a .net developer in an IT giant ....but want to js ....please tell me the way ...i joined as a fresher few days back but cant change my domain
#getting top10 links and printing them and opening all those lionks in new tab import time from googlesearch import search import webbrowser web=input("eneter to search") url=[] for i in search(web,stop=10): print(i) webbrowser.open_new_tab(i) time.sleep(1) url.append(i) print(url)
File "search.py", line 4, in res.raise_for_status() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/models.py", line 941, in raise_for_status raise HTTPError(http_error_msg, response=self) THIS WAS MY ERROR
Hello Hitesh, I'm using Ubuntu 18.04 As per your video, I did the same thing on my PC. Unfortunately, the webbrowser wasn't opening and showing up with the results. I'm using Google Chrome and Mozilla.
loved your video, This can be done in one line , but different links cant be open as import webbrowser query = "hi" for i in range(number_of_times): webbrowser.open("google.com/search?q={}".format(query))
Hi Hitesh. you really made good videos. I have a question. I have installed python 3.7 in my windows. when I try to install libraries like the way you did, I didn't get any libraries. it says invalid syntax. I'm completely new to this Python.
Thanks for this video bro. I have a problem using Python since as we know Python performance is not good as NodeJS performance. Can you please create a video about how to optimize Python code for better performance? 😃😃😃
One more request Hitesh, please provide part 2 of this and show how we can grab contents of each link opened !
You can do web scrapping for that
Check default browser settings.
@Brian Marlon thanks for this did this to my cousin to scare her lol I'm to lonely to have a girlfriend 😢😂
ruclips.net/video/zXif_9RVadI/видео.html&ab_channel=DataSchool
Yes.. sir we all are looking for this type of videos... ..
Sir can u start a series for intermediate python learners ... Sir thanks so much. Love u a lot
@Techy Inc. Thank you bro ❤
sir
Is he a superior officer?
“Fun malicious script”, ah yes
now I'm listening
Your 'fun' script ended up being just the thing I was looking for, thanks.
I can go to sleep now because it's 3 am and I probably should sleep
Yes if i dont work as it is you might need to make change to
soup.select('.r a') to
soup.select('#div#main > div > div > div > a')
Sir,
I want to ask you a question that is not related to this video, and request you for answer. My question is 'how some website sell windows10 genuine product key for just ₹750-₹1000, while microsoft sell it ₹8K - ₹15K. How can it possible sir? Is this cheap keys are really genuine? How many years this cheap keys can activate the windows?' This is my first comment on youtube, and I hope I'll get the true answer from you. You are the amazing knowledgeable person I've ever seen, that's why I'm asking you. And really sorry if there has been any mistake to write my comment correctly, coz I've very little knowledge about english.
And once again I must tell you that you are really amazing.
Can someone please explain the soup.select('.r a') line ? Why not just soup.select('a')
Sir it didn't open any browser in python 3.8 and also doesnt give any error it compiles and ends
Hello Hitesh!
Thanks for Such a nice Tutorial really informative.
I wrote the same code as explained in video but while running the scipts using cmdprompt I am not seeing any webbrowser window opened for me. I tried multiple times. It is not throwing any error while running the script.
Please let me know how to resolve this.
I got it correct
the syntax of regex expression need to modify to -->linkElements = soup.select(r'a')
instead of linkElements = soup.select('.r a') it worked for me.
@@vipulgarg5336 thanks bro
@@vipulgarg5336 Thanks alot broo you are a savior !!
@@vipulgarg5336 thankful to u
thanks!
thanks a lot for all my movie tickets in advance
This video is proof anything is better than python
Your code doesn't give any error but it is not opening the browser. How can I solve this?
hiya there, i'm working with windows so whenever i call from my system the code nothing happen what i could, there is not any error, but neither a single browser open.
Same Here
same here
same thing and I'm sitting in front my laptop for 15 minutes like a sleep paralysis demon who hasn't slept for days
i was doing in pycharm, and i took off the '.r' from the soup.select
soup = bs4.BeautifulSoup(res.text, 'html.parser')
linkElements = soup.select('a')
linkToOpen = min(1, len(linkElements))
for i in range(linkToOpen):
webbrowser.open('ruclips.net/user/results?search_query='+quest)
Sir
Is it possible to scrap audio/video files from Google search results.
Ex: If i search for a song in Google then, we can scrap all audio files from that results. We don't have to go inside any website.
Sir if possible then please make a video in this
🙂
hello mine is finishing the debugging without any results or errors what is the problem
OmNs hey hey hey please tell me from where you learn so much python library in proper way (book, website, college, RUclips) please 🙏 🙏 tell me
Very super 👏! Thanks... Feeling very happy while running this code. You live long well so we know more😎... Thanks from hearts !
where is the part where the search word is used in the code?
Hi, Thanks for the video. I see this was done in Oct 2018 hency may have worked that time. But now, it doesn't work. Because requests.get() doesn't return complete HTML code. So basically your line no 6 returns empty list.
Do you have a solution to overcome this?
have you found any solution?
@@iamivjot you have to use selenium library to do open browser instead of the requests library. Hope it helps.
@@sualehalam4259 how exactly should I change the code- should it just be importing selenium and that’s it? Or is there more to it
result is not open in browsser
To run in windows .. we should type .... python searcher.py 'youtube' or python3 searcher.py 'youtube' ?? (1st one isn't working)
what changes would i need to make if i was using a different search engine?
Why don't open a web browser?
Hi, Thank you for the video. What did you do while searching for the keyword 'HiteshChoudhary'. I'm running in Jupyter notebook did not understand it.
Hi Hitesh, its just lovely, I want to learn more in Web Automation using bs4 or Selenium, please let me know if you have designed a course on this!
Everytime after watching your video the energy and your dedication makes me to work even harder .
My android app will hit the play store very soon sir.
Thank u Hitesh sir
Please Help Me.. what if I want to search anything in compiler
Does not work.
soup.select('.r a') returns an empty list!
Yes
same
i have removed .r from that line... now it look like soup.select('a') instead of this soup.select('.r a').... and its working
actually the correct syntax to use raw strings in this case could be this soup.select(r'a') where r is outside the single quotes not inside!
@@haiderghufran7323 Returns invalid syntax!!
what if we just want to fetch number of search results for a term in a sheet rather than opening links?
how to play spotify songs in python
I started watching your videos when I started learning programming 8 months ago,and this the first technical video of yours that I could understand.😚😁😁
Just wanted to know how to make it work in background plz help
Miine did not search the code just ran. But nothing searched
U can do many thing but ur doing teaching jobs thank you
please make an updated version of this!
I tried this code but not working
My program is successfully running but not giving appropriate output.
Really Python is getting popular !,than before.
☺️☺️ ☺️☺️☺️ ☺️🙂🙂 🙂🙂🙂
python - Always popular, even from my Engineering time
Is there a Way to get the amount of search results?
it is not working in jupyther, can you say proces in jupyter
Dear sir its fun more fun is one of search says Hitesh sir joined 24 Oct 2011 also its true amazing sir .Thank you so much.
Bro how can I give input to this
My script is not working on the linkElements = soup.select('.r a') as it returns 'null'. Thoughts?
Hi Hitesh,
Your video was really helpful. I started python recently and it was really helpful.
I have a request it it possible to right those code on Jupyter notebook as I was using Jupyter. I tried this same libraries but they are not working. So if you can help me that would be really helpful.
Thank you
i tried but its not working....cd Desktop/test/
I dont understand the meaning of "ls" i guess thats why it didnt work...help pls
Sir, plz share the link of your desktop wallpaper. I really like it.
Check description
the script runs but it doesn't show the results in my browser
any idea what's going on with my issue ?
i have the same problem, anyone have an idea?
searching into comments i foum these, i hope you can use it, for me is worked
"vipul garg"
Hace 7 meses (editado)
I got it correct
the syntax of regex expression need to modify to -->linkElements = soup.select(r'a')
instead of linkElements = soup.select('.r a') it worked for me.
i ran this on windows using visual studio. it didnt work for me. it said erorn 2=file directory cannot be found. i have changed the path severally but still fails. any way out?
sir where to write parameter while running this code using pycharm
HI, I had same issue,
I changed code that way:
search_terms = search_terms.replace(' ', '%20')
url = 'google.com/search?q='+''.join(search_terms)
print(url)
res = requests.get(url)
But i am having issues getting href links. I am unsure if the css_selector changes from one country to another.
You are back.... was missing your videos....when flutter and Adobe will continue?
How about if i am searching for multiple names or object in google?
Hi Hitesh,
I have multiline text from tkinter UI which is stored in var 'a'. how do i use that var 'a' for searching in google instead of this string i.e. your name? Please revert back with that 1/2 line of code.
**fun**, and malicious do not belong in the same sentence lol.
Hi Hitesh, i followed your instruction but doesn't seem to work.. is it the functions has changed? please advise thank!
linkElement = soup.select('.r a') ----- this line is not opening any pages in browser
when i remove (.r) it opens perfectly but i get 2 extra blank google search pages first then the desired result appears....any solutions?
Hello,
I tried the same and I got what you said some extra empty tabs
So I dig into some concepts and modified the present code
The present basics of code working are same we make requests open url using webbrowser library but I saw a pattern that in this link for example www.google.com/ after this part is there is /search?q= part with arguments infront of it as said in video it opens according to arguments but if it is not then it just opens home page of google that is www.google.com
www.google.com/search?q=PewDiePie&ie=UTF-8&source=lnms&tbm=shop&sa=X&ved=0ahUKEwja_vjouM3sAhXPXCsKHTKIDkYQ_AUIDCgF
So I wrote a code such that it checks if that q tage for arguments is present or not and then proceed to consider it as a link to be opened
Here is the code ( Just a try from me anyone could do it better and modify this, and look out for indentations if you are copying this code and trying it in compiler)
import requests, sys, webbrowser, bs4
def search(text) :
linkElements = []
linkToOpen = []
i = 0
res = requests.get('google.com/search?q='+''.join(text))
res.raise_for_status()
soup = bs4.BeautifulSoup(res.text, "html.parser")
linkElements = soup.find_all('a')
while(len(linkToOpen)
@@sinnerman-i4r Thank you bro!
@@aminoobgamer5467 😊👍
Sir....i am working as a .net developer in an IT giant ....but want to js ....please tell me the way ...i joined as a fresher few days back but cant change my domain
i wrote the same program but why i am getting error in line 3???
What apps do i need to do this?
Really liked this video!
Where can I find the whole series of python videos?
www.learncodeonline.in
@@yashrajanshukla7790 learncodeonline.in not com buddy
Oops.. sorry
I'm getting HTTPError for the line (raise_for_status()) and it also say's service for requested url is unavailable ?? ;(
How can i do exactly this thing using voice command....?? Thanks in advance 🙂
why not use direct api ? this is wrong approch
#getting top10 links and printing them and opening all those lionks in new tab
import time
from googlesearch import search
import webbrowser
web=input("eneter to search")
url=[]
for i in search(web,stop=10):
print(i)
webbrowser.open_new_tab(i)
time.sleep(1)
url.append(i)
print(url)
bro code is compiled but no t opening in browser nd not even in pycharm too can u help
Some one plz suggest me how i can scrape all the text(or data ) from the first result
I cannot test a file idk where to go
When you talk fast your accent screams i.n.d.i.a.n
Anyone know why it doesn't work? LinkElements is always empty for me
File "search.py", line 4, in
res.raise_for_status()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
THIS WAS MY ERROR
same here
this code has an error
IndentationError: expected an indented block
3:00 my favourite xD
u got my like
linkelements is returning an empty list >>can any1 help
Hi Hitesh, what is sys.argv[1:]
mine opens and closes immediately how can i fix it.
Sir as always, you are the best.....
I have to say that learning programming from you is awsm and make things easier thanks a lot for your help keep doing
making things easier is my first goal. :)
Not working!
I used your code but it doesnt work
Every line got 1 minute to explain.
This code is not running for me sir, I m using pycharm
Let's make the hot and sour soup
sir what about Firebase ML-kit Face detection tutorial???
still waiting for that tutorial😎
Very soon
Why did you go for Leancodeonline.in and not learncodeonline.com ?
Some youtubers will say, it's because I love my country.
But I will not say that.
Hitesh bro using .com instead of .in is advantageous
Hello Hitesh,
I'm using Ubuntu 18.04
As per your video, I did the same thing on my PC. Unfortunately, the webbrowser wasn't opening and showing up with the results.
I'm using Google Chrome and Mozilla.
so change the refernce to mozilla or bing and trying!
can u do a video on how to convert py to exe plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Ok for some reason it doesn't run so can you help either way good tutorial
loved your video,
This can be done in one line , but different links cant be open
as
import webbrowser
query = "hi"
for i in range(number_of_times):
webbrowser.open("google.com/search?q={}".format(query))
This code doesn’t even look like it works
Ok give a try, if found some error, provide it, will help me a lot, in correcting myself, thanku
bro it does work but i want to make with href
can anyone help me pls
@@yungoracle3490 use beautifulsoup and scrape the link!!! You can find tutorial of this, this video is also very helpful
Sir, I am getting 503 server error, service unavailable for ulr: https....
I also added user agent still
Pls give link of your Python series
Is this taught by you? Hitesh sir
Did you try run the same code now? I think that doens't work
It doesn’t work any way to make it work?
Really a nice video to watch. I'll love to see some more cool Python videos of yours.
So any suggestions bro .
There is a python mini series of web scraping, check that out.
Hi Hitesh. you really made good videos. I have a question. I have installed python 3.7 in my windows. when I try to install libraries like the way you did, I didn't get any libraries. it says invalid syntax. I'm completely new to this Python.
you have to run cmd as administrator
Thanks for this video bro. I have a problem using Python since as we know Python performance is not good as NodeJS performance. Can you please create a video about how to optimize Python code for better performance? 😃😃😃
How can i open these links using voice in my chatbot Maya
Make some viedo over PHP programming tooo sir.and we all love it efforts sir😍
Yes right.
I liked the video first then start watching because you always give us awesome quality content sir.
how can you do this with javascript?
sir this program is not running in my Mac I install all required
stufs
Then it is working
hey can you say something about cs16 programming language