I am trying to make a voice assistant with python. I need to know how to find the immediate answer to a question that comes up in bold when you look it up on google. For instance http://www.google.co.uk/search?q=what+is+the+capital+of+ethiopia is Addis Ababa. Any help would be greatly appreciated.
If you mean how to immediately get redirected to the "I'm feeling lucky", then append this to the query string: btnI=1. Or, as a complete URL based on your example:
https://www.google.co.uk/search?q=what+is+the+capital+of+ethiopia&btnI=1
Related
Basically, I'm trying to write python script that runs on my computer and detects new posts in a group and if it has some keywords in it, it comments a specified string. I'm currently stuck at the beginning.
Initially, I wanted to use Graph API, but it required some kind of business verification. I haven't found a working alternative yet, so literally any advice is more than welcome.
Thank you in advance for all answers!
I need to mention particular user in the message that I sent to a group in Skype. I can send the message easily with the skpy but can't figure it out how to mention someone in the message.
sk=Skype("userid","paasword")
SendMsgTo=sk.chats["group-id"]
SendMsgTo.sendMsg("hello")
there is this sendRaw() thing in skpy which I think I'll have to use, but can't figure it out how to use.
I am new to python and finding my way through the google and the great community of stackoverflow and the similar. So a little help will greatly be appreciated
You can use
SendMsgTo.sendMsg('<at id="8:USER_ID">USER_NAME</at> ', rich=True)
also, if you don't know USER_ID use the SendMsgTo.userIds to find all USER_ID in the group
Ok, so I've looked around on how to do this and haven't really found an answer that showed me examples that I could work from.
What I'm trying to do is have a script that can do things like:
-Log into website
-Fill out forms or boxes etc.
Something simple that might help me in that I though of would be for example if I could write a script that would let me log into one if those text message websites like textnow or something like that, and then fill out a text message and send it to myself.
If anyone knows a good place that explains how to do something like this, or if anyone would be kind enough to give some guidance of their own then that would be greatly appreciated.
So after some good answers and further research, I have found that selenium is the thing that best suits my needs. It works not only with python, but supports other languages as well. If anyone else is looking for something that I had been when I asked the my question, a quick Google search for "selenium" should give them all the information they need about the tool that I found best for what I needed.
I am new with Python and am trying to create a program that will read in changing information from a webpage. I'm not sure if what I'm wanting to do is something simple or possible but in my head it seems do-able and relatively. Specifically I am interested in pulling in the song names from Pandora as they change. I have tried looking into just reading in information from a webpage using something like
import urllib
import re
page = urllib.urlopen("http://google.com").read()
re.findall("Shopping", page)
['Shopping']
page.find("Shopping")
However this isn't really what I'm wanting due to it getting information that doesn't change. Any advice or a link to helpful information about reading in changing info from a webpage would be greatly appreciated.
The only way this is possible (without some type of advanced algorithm) is if there are some elements of the page that do NOT change, which you can specify your program to look for. Otherwise, I believe you will need some sort of advanced logic. After all, computers can only do what we instruct them to do. Sorry :)
i have been trying to scrap google search data.
Let me explain what i have done so far.
i have used google module to get the search results, with Beautiful soup. Below i have given the sample search i have made,
>>> from google import search
>>>
>>> for i in search("tom and jerry", tld="co.in",num=10,stop=1): print i
https://www.youtube.com/watch?v=mugo5LoG8Ws
https://en.wikipedia.org/wiki/Tom_and_Jerry
http://www.dailymail.co.uk/debate/article-2390792/How-sense-humour-censor-Tom-Jerry-racist-By-Mail-TV-critic-CHRISTOPHER-STEVENS.html
http://edp.wikia.com/wiki/Tom_and_Jerry
https://www.youtube.com/watch?v=gSK5curwV_o
https://www.youtube.com/watch?v=xb8jTvSwJbw
https://www.youtube.com/watch?v=Kj8VuTr5q9g
https://www.youtube.com/watch?v=iIprJoPTJoI
https://www.youtube.com/watch?v=UaX3hvrZDJA
http://www.cartoonnetwork.com/games/tomjerry/
https://www.facebook.com/TomandJerry/
http://www.dailymotion.com/video/x2mn36a
http://www.dailymotion.com/video/x2p0k8j
>>>
But this result actually differs from the manual search result.
How actually it differs, if we make any changes to the init.py file of google library we can get some efficient result?
Please sort me out a possible way..
Thanks in advance.
[Note] : already surfed for previous discussions in stackoverflow. If it is a Dup, I apologize... :)
EDIT 1: Also i get duplicate links sometimes,. First link is repeated few times in the generator output i am getting from google.search(*arg) command. Please advice me how to get rid of this
I got how this DUP came. It is the sublinks shown for the popular websites in google search page.
sorry the pixel was too small. :)
Researching more on the API output and the way the output is parsed. Thanks for all who could have thought of helping me :)