# Buggy code
def parse(self, data, mode):
    """
    Parse search results for items.

    :param data: The raw response from a search
    :param mode: The current mode used to search, e.g. RSS

    :return: A list of items found
    """

    def process_column_header(td):
        return td.get_text(strip=True).lower()

    items = []

    with BS4Parser(data, "html5lib") as html:
        # We need to store the post url, to be used with every result later on.
        post_url = html.find("form", {"method": "post"})["action"]

        table = html.find("table", class_="xMenuT")
        rows = table("tr") if table else []
        row_offset = 1
        if not rows or not len(rows) - row_offset:
            log.debug("Data returned from provider does not contain any torrents")
            return items

        headers = rows[0]("th")
        # 0, 1, subject, poster, group, age
        labels = [
            process_column_header(header) or idx for idx, header in enumerate(headers)
        ]

        # Skip column headers
        rows = rows[row_offset:]
        for row in rows:
            try:
                col = dict(list(zip(labels, row("td"))))
                nzb_id_input = col[0 if mode == "RSS" else 1].find("input")
                if not nzb_id_input:
                    continue
                nzb_id = nzb_id_input["name"]
                # Try and get the the article subject from the weird binsearch format
                title = self.clean_title(col["subject"].text, mode)

            except AttributeError:
                log.debug(
                    "Parsing rows, that may not always have usefull info. Skipping to next."
                )
                continue
            if not all([title, nzb_id]):
                continue
            # Obtain the size from the 'description'
            size_field = BinSearchProvider.size_regex.search(col["subject"].text)
            if size_field:
                size_field = size_field.group(1)
            size = convert_size(size_field, sep="\xa0") or -1
            size = int(size)

            download_url = urljoin(
                self.url,
                "{post_url}|nzb_id={nzb_id}".format(post_url=post_url, nzb_id=nzb_id),
            )

            # For future use
            # detail_url = 'https://www.binsearch.info/?q={0}'.format(title)
            human_time = True
            date = (
                col["age" if mode != "RSS" else "date"]
                .get_text(strip=True)
                .replace("-", " ")
            )
            if mode == "RSS":
                human_time = False
            pubdate_raw = date
            pubdate = self.parse_pubdate(pubdate_raw, human_time=human_time)

            item = {
                "title": title,
                "link": download_url,
                "size": size,
                "pubdate": pubdate,
            }
            if mode != "RSS":
                log.debug("Found result: {0}", title)

            items.append(item)

    return items


# Traceback (AttributeError)
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 73871: 'Futurama' S06E11 status is: 'Snatched (Best)'. Ignoring result with quality 'SD DVD'. Reason: Episode status is not Downloaded, Snatched or Snatched Proper. Ignoring new quality
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Ignoring Futurama.S06E01-13.2010.DUAL.BDRip.XviD.AC3.-HQRips
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Matched release Hell.On.Wheels.S02E04.720p.WEB-DL.AAC2.0.H.264-CtrlHD.[PublicHD] to a series in your database: Hell on Wheels
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Parsed Hell.On.Wheels.S02E04.720p.WEB-DL.AAC2.0.H.264-CtrlHD.[PublicHD] into title: Hell On Wheels, season: 2, episode: [4], screen_size: 720p, format: WEB-DL, audio_codec: AAC, audio_channels: 2.0, video_codec: h264, release_group: CtrlHD, type: episode, parsing_time: 0.0310001373291, total_time: 0.0310001373291, absolute_episode: [], quality: 720p WEB-DL
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 212961: Allowed, Preferred = [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL, 1080p WEB-DL, 720p BluRay ] [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL ] Found = [ 720p WEB-DL ]
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 212961: 'Hell on Wheels' S02E04 status is: 'Downloaded'. Accepting result with quality '720p WEB-DL'. Reason: Existing quality is no longer in any wanted quality lists. Accepting new quality
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 212961: Using cached results from Torrentz2 for series u'Hell on Wheels' episode S02E04
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Quality of Futurama.S06E04.DvdRip.XviD.DutchReleaseTeam.(dutch.subs.nl) is SD DVD
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 73871: Allowed, Preferred = [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL, 1080p WEB-DL, 720p BluRay ] [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL ] Found = [ SD DVD ]
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 73871: 'Futurama' S06E04 status is: 'Downloaded'. Accepting result with quality 'SD DVD'. Reason: Existing quality is no longer in any wanted quality lists. Accepting new quality
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Ignoring Futurama.S06E04.DvdRip.XviD.DutchReleaseTeam.(dutch.subs.nl) based on ignored words filter: dutch
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] No wanted results found.
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Matched release X:\TV\Futurama\Season 6\S06E04 - Proposition Infinity to a series in your database: Futurama
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Parsed X:\TV\Futurama\Season 6\S06E04 - Proposition Infinity into title: Futurama, season: 6, episode: [4], episode_title: Proposition Infinity, type: episode, parsing_time: 0.0239999294281, total_time: 0.0239999294281, absolute_episode: [], quality: SDTV
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Found codec for Futurama Proposition Infinity
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 73871: Formatting pattern: %SN - S%0SE04 - %EN -> Futurama - S06E04 - Proposition Infinity
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] All found results for Futurama - S06E04 - Proposition Infinity were rejected.
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Quality of Eureka.S01E04.(2006).DVDRip.Dutch.subs.NLT.(DivX) is SD DVD
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: Allowed, Preferred = [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL, 1080p WEB-DL, 720p BluRay ] [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL ] Found = [ SD DVD ]
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: 'Eureka' S01E04 status is: 'Downloaded'. Accepting result with quality 'SD DVD'. Reason: Existing quality is no longer in any wanted quality lists. Accepting new quality
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Ignoring Eureka.S01E04.(2006).DVDRip.Dutch.subs.NLT.(DivX) based on ignored words filter: dutch
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] No wanted results found.
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Matched release X:\TV\Eureka\Season 1\S01E04 - Alienated to a series in your database: Eureka
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Parsed X:\TV\Eureka\Season 1\S01E04 - Alienated into title: Eureka, season: 1, episode: [4], episode_title: Alienated, type: episode, parsing_time: 0.0199999809265, total_time: 0.0199999809265, absolute_episode: [], quality: Unknown
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Found codec for Eureka Alienated
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: Formatting pattern: %SN - S%0SE04 - %EN -> Eureka - S01E04 - Alienated
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] All found results for Eureka - S01E04 - Alienated were rejected.
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Quality of Anthony.Bourdain.Parts.Unknown.S10E02.French.Alps.720p.HDTV.x264-SOIL.mkv is 720p HDTV
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 264108: Allowed, Preferred = [ 720p HDTV, 1080p HDTV, 720p WEB-DL, 1080p WEB-DL, 720p BluRay, 1080p BluRay ] [ 720p HDTV, 1080p HDTV, 720p WEB-DL, 1080p WEB-DL ] Found = [ 720p HDTV ]
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 264108: 'Anthony Bourdain: Parts Unknown' S10E02 status is: 'Wanted'. Accepting result with quality '720p HDTV'. Reason: Current status is 'WANTED'. Accepting result with quality '720p HDTV'
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Ignoring Anthony.Bourdain.Parts.Unknown.S10E02.French.Alps.720p.HDTV.x264-SOIL.mkv based on ignored words filter: french
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] No wanted results found.
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 264108: Formatting pattern: %SN - S%0SE02 - %EN -> Anthony Bourdain Parts Unknown - S10E02 - French Alps
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] All found results for Anthony Bourdain Parts Unknown - S10E02 - French Alps were rejected.
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Quality of Eureka.S01E02.(2006).DVDRip.Dutch.subs.NLT.(DivX) is SD DVD
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: Allowed, Preferred = [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL, 1080p WEB-DL, 720p BluRay ] [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL ] Found = [ SD DVD ]
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: 'Eureka' S01E02 status is: 'Downloaded'. Accepting result with quality 'SD DVD'. Reason: Existing quality is no longer in any wanted quality lists. Accepting new quality
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Ignoring Eureka.S01E02.(2006).DVDRip.Dutch.subs.NLT.(DivX) based on ignored words filter: dutch
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] No wanted results found.
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Matched release X:\TV\Eureka\Season 1\S01E02 - Many Happy Returns to a series in your database: Eureka
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Parsed X:\TV\Eureka\Season 1\S01E02 - Many Happy Returns into title: Eureka, season: 1, episode: [2], episode_title: Many Happy Returns, type: episode, parsing_time: 0.0210001468658, total_time: 0.0210001468658, absolute_episode: [], quality: Unknown
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Found codec for Eureka Many Happy Returns
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: Formatting pattern: %SN - S%0SE02 - %EN -> Eureka - S01E02 - Many Happy Returns
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] All found results for Eureka - S01E02 - Many Happy Returns were rejected.
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Quality of Eureka.S01E06.(2006).DVDRip.(Dutch.NL.subs).NLT.DivX is SD DVD
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: Allowed, Preferred = [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL, 1080p WEB-DL, 720p BluRay ] [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL ] Found = [ SD DVD ]
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: 'Eureka' S01E06 status is: 'Downloaded'. Accepting result with quality 'SD DVD'. Reason: Existing quality is no longer in any wanted quality lists. Accepting new quality
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Ignoring Eureka.S01E06.(2006).DVDRip.(Dutch.NL.subs).NLT.DivX based on ignored words filter: dutch
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] No wanted results found.
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Matched release X:\TV\Eureka\Season 1\S01E06 - Dr. Nobel to a series in your database: Eureka
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Parsed X:\TV\Eureka\Season 1\S01E06 - Dr. Nobel into title: Eureka, season: 1, episode: [6], episode_title: Dr Nobel, type: episode, parsing_time: 0.0280001163483, total_time: 0.0280001163483, absolute_episode: [], quality: Unknown
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Found codec for Eureka Dr. Nobel
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: Formatting pattern: %SN - S%0SE06 - %EN -> Eureka - S01E06 - Dr. Nobel
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] All found results for Eureka - S01E06 - Dr. Nobel were rejected.
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Quality of Eureka.S01E01.(2006).DVDRip.Dutch.subs.NLT.(DivX) is SD DVD
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: Allowed, Preferred = [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL, 1080p WEB-DL, 720p BluRay ] [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL ] Found = [ SD DVD ]
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: 'Eureka' S01E01 status is: 'Downloaded'. Accepting result with quality 'SD DVD'. Reason: Existing quality is no longer in any wanted quality lists. Accepting new quality
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Ignoring Eureka.S01E01.(2006).DVDRip.Dutch.subs.NLT.(DivX) based on ignored words filter: dutch
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] No wanted results found.
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Matched release X:\TV\Eureka\Season 1\S01E01 - Pilot to a series in your database: Eureka
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Parsed X:\TV\Eureka\Season 1\S01E01 - Pilot into title: Eureka, season: 1, episode: [1], episode_title: Pilot, type: episode, parsing_time: 0.0230000019073, total_time: 0.0230000019073, absolute_episode: [], quality: Unknown
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Found codec for Eureka Pilot
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 79334: Formatting pattern: %SN - S%0SE01 - %EN -> Eureka - S01E01 - Pilot
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] All found results for Eureka - S01E01 - Pilot were rejected.
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Quality of Hell.On.Wheels.S02E04.720p.WEB-DL.AAC2.0.H.264-CtrlHD.[PublicHD] is 720p WEB-DL
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 212961: Allowed, Preferred = [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL, 1080p WEB-DL, 720p BluRay ] [ SD DVD, RawHD, 1080p HDTV, 720p WEB-DL ] Found = [ 720p WEB-DL ]
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] 212961: 'Hell on Wheels' S02E04 status is: 'Downloaded'. Accepting result with quality '720p WEB-DL'. Reason: Existing quality is no longer in any wanted quality lists. Accepting new quality
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Found wanted results.
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Sorting the following results: [u'Hell.On.Wheels.S02E04.720p.WEB-DL.AAC2.0.H.264-CtrlHD.[PublicHD]']
2018-08-04 15:19:22 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Computed result scores:
Score  Release
100.00 Hell.On.Wheels.S02E04.720p.WEB-DL.AAC2.0.H.264-CtrlHD.[PublicHD]
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Torrentz2] :: [f5973b2] Picked Hell.On.Wheels.S02E04.720p.WEB-DL.AAC2.0.H.264-CtrlHD.[PublicHD] as the best result.
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [f5973b2] Downloading King.of.the.Hill.S13E08.720p.WEB-DL.DD5.1.H.264-MURPHY with size: 0.00 B from BinSearch
2018-08-04 15:19:22 INFO     SEARCHQUEUE-DAILY-SEARCH :: [f5973b2] Downloading King.of.the.Hill.S13E08.720p.WEB-DL.DD5.1.H.264-MURPHY from BinSearch at https://www.binsearch.info/fcgi/nzb.fcgi?adv_age=&max=250&server=1&q=King+of+the+Hill+S13E08&xminsize=20|nzb_id=248136468 and data {u'action': u'nzb', u'248136468': u'on'}
2018-08-04 15:19:44 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [f5973b2] Error requesting url https://www.binsearch.info/fcgi/nzb.fcgi?adv_age=&max=250&server=1&q=King+of+the+Hill+S13E08&xminsize=20 Error: ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))
2018-08-04 15:19:44 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [f5973b2] DailySearchQueueItem Exception, error: 'NoneType' object has no attribute 'content'
Traceback (most recent call last):
  File "C:\Medusa\Medusa\medusa\search\queue.py", line 289, in run
    self.success = snatch_episode(result)
  File "C:\Medusa\Medusa\medusa\search\core.py", line 135, in snatch_episode
    nzb_data = result.provider.download_nzb_for_post(result)
  File "C:\Medusa\Medusa\medusa\providers\nzb\binsearch.py", line 267, in download_nzb_for_post
    verify=verify, hooks={}, allow_redirects=True).content
AttributeError: 'NoneType' object has no attribute 'content'

# Fixed code
def parse(self, data, mode):
    """
    Parse search results for items.

    :param data: The raw response from a search
    :param mode: The current mode used to search, e.g. RSS

    :return: A list of items found
    """

    def process_column_header(td):
        return td.get_text(strip=True).lower()

    items = []

    with BS4Parser(data, "html5lib") as html:
        # We need to store the post url, to be used with every result later on.
        post_url = html.find("form", {"method": "post"})["action"]

        table = html.find("table", class_="xMenuT")
        rows = table("tr") if table else []
        row_offset = 1
        if not rows or not len(rows) - row_offset:
            log.debug("Data returned from provider does not contain any torrents")
            return items

        headers = rows[0]("th")
        # 0, 1, subject, poster, group, age
        labels = [
            process_column_header(header) or idx for idx, header in enumerate(headers)
        ]

        # Skip column headers
        rows = rows[row_offset:]
        for row in rows:
            try:
                col = dict(list(zip(labels, row("td"))))
                nzb_id_input = col[0 if mode == "RSS" else 1].find("input")
                if not nzb_id_input:
                    continue
                nzb_id = nzb_id_input["name"]
                # Try and get the the article subject from the weird binsearch format
                title = self.clean_title(col["subject"].text, mode)

            except AttributeError:
                log.debug(
                    "Parsing rows, that may not always have useful info. Skipping to next."
                )
                continue
            if not all([title, nzb_id]):
                continue

            # Obtain the size from the 'description'
            size_field = BinSearchProvider.size_regex.search(col["subject"].text)
            if size_field:
                size_field = size_field.group(1)
            size = convert_size(size_field, sep="\xa0") or -1
            size = int(size)

            download_url = urljoin(
                self.url,
                "{post_url}|nzb_id={nzb_id}".format(post_url=post_url, nzb_id=nzb_id),
            )

            # For future use
            # detail_url = 'https://www.binsearch.info/?q={0}'.format(title)
            human_time = True
            date = (
                col["age" if mode != "RSS" else "date"]
                .get_text(strip=True)
                .replace("-", " ")
            )
            if mode == "RSS":
                human_time = False
            pubdate_raw = date
            pubdate = self.parse_pubdate(pubdate_raw, human_time=human_time)

            item = {
                "title": title,
                "link": download_url,
                "size": size,
                "pubdate": pubdate,
            }
            if mode != "RSS":
                log.debug("Found result: {0}", title)

            items.append(item)

    return items