小编use*_*081的帖子

AttributeError:'Response'对象没有属性'text'

page = requests.get(url)
tree = html.fromstring(page.text)
Run Code Online (Sandbox Code Playgroud)

在第2行,我得到:

AttributeError: 'Response' object has no attribute 'text'
Run Code Online (Sandbox Code Playgroud)

我已导入请求和已安装的请求.如何调试此错误?任何人都可以告诉命令安装最新的请求模块?

python python-requests

3
推荐指数
1
解决办法
2万
查看次数

动态更改wpf中网格的内容

我试图使用usercontrol动态更改网格的内容.我的mainWindow.xaml看起来像这样.

<Window x:Class="testapp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="524" Width="856">
<Grid Background="Black">
    <!--<Image Height="44" HorizontalAlignment="Left" Margin="284,0,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="229" Source="/testapp;component/Images/Picture1.png" />-->
    <Grid Height="431" HorizontalAlignment="Left" Margin="0,55,0,0" Name="grid1" VerticalAlignment="Top" Width="266" Background="Black" Opacity="0.4">
        <ListView  Height="430" HorizontalAlignment="Left" Margin="3,1,0,0" x:Name="listView1" VerticalAlignment="Top" Width="260" Background="Black">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Vertical" Height="70">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Name : " Foreground="Yellow" />
                            <TextBlock Text="{Binding Name}" Foreground="Yellow" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Height="100">
                            <TextBlock Text="Source :" Foreground="Yellow"/>
                            <TextBlock Text="{Binding Source}" Foreground="Yellow"/>
                        </StackPanel>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <Button Content="create new Group" Height="36" HorizontalAlignment="Left" Margin="6,392,0,0" Name="button1" …
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml user-controls

0
推荐指数
1
解决办法
7400
查看次数

-5
推荐指数
1
解决办法
131
查看次数

标签 统计

python ×2

c# ×1

int ×1

python-requests ×1

string ×1

type-conversion ×1

user-controls ×1

wpf ×1

xaml ×1