google-search

Setting “User-Agent” parameters for URLConnection for querying Google from a Java application

帅比萌擦擦* 提交于 2019-12-07 17:49:01
问题 I am trying to get the results back from a Google query, in Java as follows: String urlquery = "https://www.google.com/search?hl=en&gl=us&tbm=nws&q=apples&oq=apples"; URL url = new URL(urlquery); URLConnection connection = url.openConnection(); URLConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5"); But, I don't know how to set the "User-Agent" parameters above. From where

How does pageranking algorithm deal with webpage without outbound links?

╄→尐↘猪︶ㄣ 提交于 2019-12-07 05:08:26
问题 I am learning about the PageRanking algorithm so sorry for some newbie questions. I understand that the PR value is calculated for each page by the summation of incoming links to itself. Now I am bothered by a statement which stated that "the PageRank values sum to one " at wikipedia. As the example shown at wikipedia, if every page has a outbound link, then the summation of whole probabilities from each page should be one. However, if a page does not have any outbound link such as page A at

How can I set a custom width on my Google search iframe?

荒凉一梦 提交于 2019-12-07 02:40:05
问题 I am trying to use google search for my site: http://www.houseofhawkins.com/search.php It is not playing nice with some screen resolutions. Here is the code given from google: <div id="cse-search-results"></div> <script type="text/javascript"> var googleSearchIframeName = "cse-search-results"; var googleSearchFormName = "cse-search-box"; var googleSearchFrameWidth = 250; var googleSearchDomain = "www.google.com"; var googleSearchPath = "/cse"; </script> <script type="text/javascript" src=

How to set a manual filter on Google Custom Search Engine (free version)

蹲街弑〆低调 提交于 2019-12-07 00:53:36
问题 How can I set a manual filter on Google Custom Search Engine (not from CSE panel)? For example, to open the link in a new tab I'm using this code: <gcse:searchresults-only linktarget="_blank"></gcse:searchresults-only> Now I want to set the "safe mode", and also set the results per page (to show 10 results, for instance). To be clearer, I want to allow users to change those filters from my website, that's is why I'm trying to add them manually! Thanks. 来源: https://stackoverflow.com/questions

How to pass text from a textField to Google Search from an iOS app? [closed]

孤街浪徒 提交于 2019-12-06 16:57:02
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I would like to pass a string to the Google search from my iOS app, so as to enable me to fetch the results in Safari. 回答1: You can do something like this: var query = "hello world" query = query.replacingOccurrences(of: " ", with: "+") var url = "https://www.google.co.in/search?q="

Using sitelinks search bar google

瘦欲@ 提交于 2019-12-06 13:14:11
I am following this guide by Google to add a sitelinks search bar on my website. The structured data markup tool shows everything to be correct. But: The search bar hasn't appeared in the search results for my website. Google has indexed the page www.example.com/search?q=%7Bsearch_term_string%7D instead: I have the exact same code as explained in the example, except the site URL of course. What am I doing wrong? Or is this expected behaviour? <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebSite", "url": "http://www.example.com/", "potentialAction": { "@type"

Updated approach to Google search with python

隐身守侯 提交于 2019-12-06 11:58:57
I was trying to use xgoogle but I has not been updated for 3 years and I just keep getting no more than 5 results even if I set 100 results per page. If anyone uses xgoogle without any problem please let me know. Now, since the only available(apparently) wrapper is xgoogle, the option is to use some sort of browser, like mechanize, but that is gonna make the code entirely dependant on google HTML and they might change it a lot. Final option is to use the Custom search API that google offers, but is has a redicolous 100 requests per day limit and a pricing after that. I need help on which

Will Google see rel=nofollow if it is added by jQuery?

南楼画角 提交于 2019-12-06 09:16:48
I'm adding a rel=nofollow attribute to links via jQuery after the page load. Will Google see this attribute? I can't find anything in Google's official documentation. Although Google processes JavaScript and can index a lot of dynamic content, there's a special behavior when inserting rel=nofollow dynamically. It was tested [1] and they came up with this result: The nofollow in the DOM did not work (the link was followed, and the page indexed). Why? Because the modification of the a href element in the DOM happened too late: Google already crawled the link and queued the URL before it executed

Why is Google indexing Friendly URL mixed with hyphens and %20?

大城市里の小女人 提交于 2019-12-06 05:54:35
I developed a blog from scratch and things has gone great so far. I finally got around to writing my first post/article, and I've been waiting for Google to index this specific page to make sure there aren't any issue with it. Well, google is currently indexing the same page 4 times, I have (with the help of users from stackoverflow) a mod_rewrite on my htaccess to rewrite all urls to hyphens coming from a specific file (article.php). My currently article page stands as followed. example: www.site.com/article.php?article_id=10&article_title=friendly url goes over here with mod_rewrite I have

How does Market Samurai and Long Tail Pro handle retrieving the top 10 Google search results for a keyword?

半世苍凉 提交于 2019-12-06 05:38:23
问题 I'm curious to know how Market Samurai, Long Tail Pro and other software handle retrieving the top 10 Google search results and not running into limits. It appears that these software packages use the users own Google account. Google Custom Search limits users to 100 queries per day (the free limit) but people tend to do keyword research on hundreds or even thousands of keywords per day and don't pay any additional amounts to Google. Are they paying extra for this service, are they using a