def viewportstr_to_dict(viewportstr):
    """
    Args:
        viewportstr (str): viewport string (e.g. ``1024x768 mobile landscape``)
    Returns:
        dict: dict suitable for use with pyppeteer page.emulate options=
    """
    _viewportstr = viewportstr.lower()
    terms = _viewportstr.split(" ")
    width, height = map(int, terms[0].split("x", 1))
    isMobile = True if "mobile" in terms else False
    isLandscape = True if "landscape" in terms else False
    return dict(
        width=width,
        height=height,
        isMobile=isMobile,
        isLandscape=isLandscape,
        pathstr=_viewportstr.replace(" ", "-"),
    )