Selecting a dropdown menu in Safari
Tested under macOS High Sierra, here is how I do it:
set saveToLocation to &quot;~/Documents&quot;
set myURL to &quot;http://www.webiste.com/&quot;

tell application &quot;Safari&quot;
    make new document with properties {URL:myURL}
    activate
end tell

tell application &quot;System Events&quot;
    repeat until exists (buttons of ¬
        UI elements of ¬
        groups of ¬
        toolbar 1 of ¬
        window 1 of ¬
        process &quot;Safari&quot; whose ¬
        name = &quot;Reload this page&quot;)
        delay 0.5
    end repeat
    tell application process &quot;Safari&quot;
        click menu item &quot;Export as PDF…&quot; of ¬
            menu &quot;File&quot; of ¬
            menu bar item &quot;File&quot; of ¬
            menu bar 1
        repeat until exists sheet 1 of window 1
            delay 0.05
        end repeat
        keystroke &quot;g&quot; using {shift down, command down}
        repeat until exists sheet 1 of sheet 1 of window 1
            delay 0.05
        end repeat
        set value of ¬
            combo box 1 of ¬
            sheet 1 of ¬
            sheet 1 of ¬
            window 1 to ¬
            saveToLocation
        click button &quot;Go&quot; of sheet 1 of sheet 1 of window 1
        click button &quot;Save&quot; of sheet 1 of window 1
    end tell
end tell


Note: The example AppleScript code is just that and does not contain any additional error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g. delay 0.5, with the value of the delay set appropriately.