WebSearch

WebSearch["string"]

gives a dataset of the top web search results for the specified literal string.

WebSearch[form]

gives the top results obtained by doing the web search specified by form.

WebSearch[form,elems]

gives the elements of the web search specified by elems.

Details and Options

  • WebSearch requires internet connectivity and uses external services that require Service Credits.
  • WebSearch supports the following basic search forms, which can be combined arbitrarily:
  • stringstring is the query for the search engine
    "string"complete string must occur in the page
    {s1,s2,}search for all si in the page
    s1|s2|at least one of the si must occur in the page
    "field"s1the si must occur in the given field
    Except[q]q cannot occur in the page
  • Possible fields include:
  • "Country"search only within a given country's web domain
    "Site"search only within specified website
    "FileFormat"search only for files with the specified format
  • File formats can be specified either by strings as used by Import or by entities of type "FileFormat".
  • Possible options include:
  • AllowAdultContentFalsewhether to include adult-type results
    Language Nonegive only pages in the specified language
    MaxItems 10number of results to return
    Method Automaticexternal search service to use
  • Languages can be specified using entities of type "Language" or strings corresponding to standard names of languages.
  • Possible settings for Method include "Google" and "Bing".
  • Possible elements that can be specified by elems include:
  • "PageTitles"page titles
    "Snippets"textual snippets of page content
    "Hyperlinks"page hyperlinks

Examples

open allclose all

Basic Examples  (4)

Perform a basic web search:

Search using alternatives:

Search for pages containing all specified terms:

Create a word cloud from web search snippets:

Scope  (3)

Search Fields  (2)

Filter results by country:

Filter results by file format:

Elements  (1)

Retrieve only textual snippets for all search results:

Options  (3)

Language  (1)

Search for pages in a specified language:

MaxItems  (1)

Specify the maximum number of results to retrieve:

Method  (1)

Specify a search engine:

Wolfram Research (2017), WebSearch, Wolfram Language function, https://reference.wolfram.com/language/ref/WebSearch.html.

Text

Wolfram Research (2017), WebSearch, Wolfram Language function, https://reference.wolfram.com/language/ref/WebSearch.html.

CMS

Wolfram Language. 2017. "WebSearch." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WebSearch.html.

APA

Wolfram Language. (2017). WebSearch. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WebSearch.html

BibTeX

@misc{reference.wolfram_2024_websearch, author="Wolfram Research", title="{WebSearch}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/WebSearch.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_websearch, organization={Wolfram Research}, title={WebSearch}, year={2017}, url={https://reference.wolfram.com/language/ref/WebSearch.html}, note=[Accessed: 21-November-2024 ]}