Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用cssutils访问或读取页面规则的属性_Python_Css - Fatal编程技术网

Python 使用cssutils访问或读取页面规则的属性

Python 使用cssutils访问或读取页面规则的属性,python,css,Python,Css,我已经在css文件中读/写了字体规则和样式规则的属性。 使用cssutils版本0.9.6和python编程语言。 我尝试读取、访问页面规则的属性。 但读取page_规则样式表中的属性时会出现问题。page规则中的属性将类型指定为未知规则。 那么如何读取页面规则的属性呢 在解析css文件时,我将selectorText/类名设置为:blank property.atkeyword设置为@top left@top center 但是没有得到那些属性的内容和价值? 对于ex,css文件中的行为:

我已经在css文件中读/写了字体规则和样式规则的属性。
使用cssutils版本0.9.6和python编程语言。
我尝试读取、访问页面规则的属性。 但读取page_规则样式表中的属性时会出现问题。page规则中的属性将类型指定为未知规则。 那么如何读取页面规则的属性呢 在解析css文件时,我将selectorText/类名设置为:blank property.atkeyword设置为@top left@top center 但是没有得到那些属性的内容和价值? 对于ex,css文件中的行为:

  @page:blank {
   @top-left { 
       content: normal;
       }
   @top-center { 
       content: normal;
      }
   }
我想正常读取属性内容和值,所有这些都是使用cssutils而不是使用正则表达式来读取的

选择器的语法是:

@page [identifier][:(first|left|right)]
因此,问题中给出的示例无效,因为“blank”不是
伪页面

你的意思可能是:

@page blank {
    @top-left { 
       content: normal;
       }
    @top-center { 
       content: normal;
      }
}
哪个
cssutils
解析正确