Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR | logging:exception:line:1524 | global flags not at the start of the expression at position 2 #210

Open
LinMu746 opened this issue Apr 10, 2023 · 2 comments

Comments

@LinMu746
Copy link

已经升级最新版本

运行环境
Python 3.11.2
Playwrigh for Python 1.32.1
Pycharm 2023.1

问题
ERROR | logging:exception:line:1524 | global flags not at the start of the expression at position 2

截图
img-2023 04 10-09 07 45

#代码

class AirspiderLawsMonthly(feapder.AirSpider):
    def start_requests(self):
        yield feapder.Request(url="https://www.pkulaw.com", render=True)

    def parse(self, request, response):
        # 使用playwright操作浏览器对象
        driver: PlaywrightDriver = response.driver
        page: Page = driver.page

        # 获取列表数据总数及二次检索
        laws_data_list = response.xpath("(//div[@class='grouping-title'])[1]")
        for laws_data in laws_data_list:
            grouping_title = laws_data.xpath("(//div[@class='grouping-title'])[1]").extract_first()
            print(grouping_title)

        # 提取网站title
        print(response.xpath("//title/text()").extract_first())
        # 提取网站描述
        print(response.xpath("//meta[@name='description']/@content").extract_first())
        print("网站地址: ", response.url)
@HandsomeMars1
Copy link

同一个问题,但是降低python版本到3.10可以解决这个问题,不知道是不是feapder和最新版本的python不匹配导致的

@xihacode
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants