The 5250 SDLC access is for interactive access – so it’s predicated on there being a person in front of the glass.
You don’t want real people getting to your data without authorisation, so it wants a user id and password.
Maybe you need to rethink the data access route and get the data you need over another (secure) access. Whatever is populating the screen you’re scraping could more efficiently populate a file your application could access.
If the “WS” profile means that this is a System i Access workstation session, then use the System i Access CWBLOGON.exe to provide userid and password before connecting the emulator session. Set the connection to “bypass signon” and skip both the pop-up and the signon display panel.
But seriously, Yorkshireman’s comment is right on. Don’t use the emulator at all. There are far better access methods for automation.