Boris-code/feapder

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

LinMu746 opened this issue · 2 comments

已经升级最新版本

运行环境
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)

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

+1