我正在尝试使用 axios 选择来自 http 请求的元素
const axios = require('axios');
axios.get('https://example.com/')
.then((response) => {
console.log(response);
});
响应看起来像:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="example">
<title>Example</title>
</head>
<body>
<div class="container">
<div class="row">
<img class="image" src="example.png" alt="example">
<div class="col">Example</div>
</div>
</div>
</body>
</html>
即我想选择.image的 src 属性。
我想在response. 如果我们能用 jQuery 做到这一点,那就太好了。我想访问它的属性和 html 内容。
慕桂英3389331
婷婷同学_
慕尼黑8549860
相关分类