Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
HTTP/2 Test using requests_html by parsing keycdn website
import requests_html
def http2_enabled(url):
scrape to find http 2/0 support of the given domain url
url = url.replace("https://", "").replace("http://", "")
session = requests_html.HTMLSession()
response = session.get("")
script = """
() => {
var value = ""
if(jQuery.isReady) {
$("#public").prop('checked', false);
value = $.post( "http2-query.php", $('#http2Form').serialize()).done(function( data ) {value = data})
return value;
result = response.html.render(script=script)
# check if the source code contains alert-success class in the bootstrap modal
return True if "alert-success" in result else False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment