def split_h1_string(doc, seps=None, part='1'):
    """Remove unwanted parts from h1 string.

    Headings or titles are often composed of multiple items,
    like 'Murder! - Domestic News - The Local Paper'.
    You want just 'Murder!'.

    Selected items are whitespace stripped.

    :param seps: strings by which heading is separated.
                 if ``None``, default ``' - ', ' : ', ' | '`` is used.

    :param part: which part to select. '1' means first, or index 0.
                 special number '-1' selects last item.

    >>> el = fromstring('<h1>aaa ~ bbb</h1>')
    >>> split_h1_string(el, '~', '2')
    >>> tostring(el)
    '<h1>bbb</h1>'
    >>> el = fromstring('<h1>aaa ~ bbb</h1>')
    >>> split_h1_string(el, '~', '-1')
    >>> tostring(el)
    '<h1>bbb</h1>'
    """
    el = doc.xpath('//h1')[0]
    if seps is None:
        seps = [' - ', ' : ', ' | ']
    if isinstance(seps, str):
        seps = [seps]
    if part == '-1':
        part = '0'
    for sep in seps:
        if sep in el.text:
            el.text = el.text.split(sep)[int(part) - 1].strip()
            break
