如何检查谷歌会议是否开放/可以加入Python

问题描述

我想制作一个 python 程序,它可以检查 google meet 是否开放/可以加入(比如从 cmd 执行 ping meet.google.com/custom-meeting-link)。 有没有我可以使用的模块/有什么方法可以做到这一点?

解决方法

如果 ping 方法有效,您可以使用它(即使不在本机 python 中)

import subprocess

ret = subprocess.run(["ping","https://meet.google.com/custom-meeting-link"])

然后检查 ret

编辑:另一种方法是请求页面并解析它。保持简单,您只需检查页面标题(此处使用 bs4):

import requests
from bs4 import BeautifulSoup

html = requests.get("meet.google.com/custom-meeting-link")
soup = BeautifulSoup(html.text,'html.parser')
titlestring = soup.find('title').text

# If title string contains the title of the error page,there's no meeting,else it is online

我检查了是否可以仅从 requests.get() 响应中推断会议状态,但似乎不可能。

,

我以前从未使用过 Google Meet,但您可能可以检测到 Google Meet 是否使用其 API 开放

Google Meet API's documentation

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...