小编Bou*_*uke的帖子

找不到模块:错误:无法解析“/home/user/Desktop/my_app/src”中的“./app”

我开始创建我的应用程序,所以我使用 webpack 实现了项目配置。项目结构为:

node_modules
public
|----bundle.js
|----index.html
src
|----app.jsx
|----index.jsx
|----components
     |-----appBar.jsx
Run Code Online (Sandbox Code Playgroud)

webpack.config.jsx:

const path = require('path');

module.exports = {
    mode: 'development',
    entry: path.resolve(__dirname, 'src/index.jsx'),
    output: {
        path: path.resolve(__dirname, 'public'),
        filename: 'bundle.js'
    },
    module: {
        rules: [
            {
                test: /\.jsx$/,
                exclude: /node_modules/,
                loader: 'babel-loader',
            }
        ]
    },
    devServer: {
        contentBase: path.join(__dirname, 'public'),
        compress: true,
        port: 9000
    }
}
Run Code Online (Sandbox Code Playgroud)

应用程序.jsx:

import ButtonAppBar  from './components/appBar';
import React from 'react';


class App extends React.Component {
    render(){
        return (
            <div>
                <ButtonAppBar />
            </div>
        ) …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs webpack

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

Python - Selenium 不会返回到上一页

当访问变量“url”中的网站时,它会自动接受 cookie,写入日期,然后单击搜索,但一旦这样做,就会显示 98 个应用程序,使其单击第一个应用程序。我做了它,所以它返回,重做它,所以它应该单击第二个应用程序,而不是返回一个错误。

有人可以尝试帮助我的脚本返回到最后一页并单击第二个应用程序吗?

错误:

[8796:7240:0913/132540.843:ERROR:install_util.cc(603)] Failed to read HKLM\SOFTWARE\Policies\Google\Chrome\MachineLevelUserCloudPolicyEnrollmentToken: The system cannot find the file specified. (0x2)

DevTools listening on ws://127.0.0.1:51391/devtools/browser/0f49248f-88a3-48b4-bf7c-975f7b52185a
Worked???
Traceback (most recent call last):
  File "C:\Users\DBaldwin\Desktop\sel.py", line 34, in <module>
    e.click()
  File "C:\Users\DBaldwin\Anaconda3\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "C:\Users\DBaldwin\Anaconda3\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute
    return self._parent.execute(command, params)
  File "C:\Users\DBaldwin\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
    self.error_handler.check_response(response)
  File "C:\Users\DBaldwin\Anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the …
Run Code Online (Sandbox Code Playgroud)

python selenium web

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

标签 统计

javascript ×1

python ×1

reactjs ×1

selenium ×1

web ×1

webpack ×1