[Tutor] How to use custom protocol with requests?

Danny Yoo dyoo at hashcollision.org
Sun Oct 12 04:53:11 CEST 2014


>> I need to call this URL: steam://friends/add/<ID>
>>
>> If I put it in my browser and press enter it works as expected, now I need
>> to do this on my code, I don't need to retrieve anything, I just need it to
>> be "executed", is there a way to do that in Python with requests or any
>> other lib?

Thinking about this a bit more. If your browser is already doing the
"right thing", maybe the webbrowser module is enough to get this
behavior:

    https://docs.python.org/2/library/webbrowser.html

webbrowser should invoke the browser on your behalf.  Maybe your web
browser is set up to dispatch this to the steam application?  Hard to
tell without testing this myself, but I'm not in an environment that
lets me try this out at the moment.


More information about the Tutor mailing list