twitter.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:MalwrAgent 作者: michaelschratt 项目源码 文件源码
def f_grab_cmd_from_twitter_profile(profile_name):
        """grab 0xXXXXXXXX tag from profile, tag must match [a-zA-Z0-9_]
        :rtype: string
        :param profile_name: twitter profile name without leading @
        :return: string embedded in the profile description
        """
        url = 'https://twitter.com/%(profile)s'
        payload = {
            'profile': profile_name
        }
        html = requests.get(url % payload)
        soup = soupy(html.text)
        profile_description = soup.find('meta', {'name': 'description'})['content']
        match = re.search('0x(\w+)', profile_description)
        output = match.group(1)  # group 1 consists of match between ( )

        return str(output)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号