'Search the web with Bing.
This method is based from the msn.py file from the massive enumeration
toolset, coded by pdp and released under GPL v2.'

def search(self, query, start, count=10):

    url = 'http://www.bing.com/search?'
    query = urllib.urlencode({'q': query, 'first': (start + 1), 'FORM': 'PERE'})
    url_instance = URL((url + query))
    response = self._uri_opener.GET(url_instance, headers=self._headers, cache=True, grep=False, follow_redirects=True)
    re_match = re.findall('<a    href="((http|https)(.*?))"    h="ID=SERP,', response.get_body())
    results = set()
    for (url, _, _) in re_match:
        try:
            url = URL(url)
        except ValueError:
            pass
        else:
            if (url.get_domain() not in self.BLACKLISTED_DOMAINS):
                for blacklisted_domain in self.BLACKLISTED_DOMAINS:
                    if (blacklisted_domain in url.get_domain()):
                        break
                else:
                    bing_result = BingResult(url)
                    results.add(bing_result)
    return results
