質問編集履歴
1
別のファイルで試したことを追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -232,9 +232,113 @@
|
|
232
232
|
|
233
233
|
### 試したこと
|
234
234
|
|
235
|
-
|
235
|
+
追記1
|
236
|
+
|
236
|
-
|
237
|
+
なんのモジュールも入れずに下記だけはくファイルを実行ファイルにしたところうまく実行できていました。
|
238
|
+
|
239
|
+
```python
|
240
|
+
|
237
|
-
|
241
|
+
print('test')
|
242
|
+
|
243
|
+
```
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
追記2
|
248
|
+
|
249
|
+
一つのファイルでseleniumなど入れたところまた別のエラーが出ておりました。
|
250
|
+
|
251
|
+
```python
|
252
|
+
|
253
|
+
from selenium import webdriver
|
254
|
+
|
255
|
+
from selenium.webdriver.common.keys import Keys
|
256
|
+
|
257
|
+
from selenium.webdriver.common.by import By
|
258
|
+
|
259
|
+
import chromedriver_binary
|
260
|
+
|
261
|
+
from selenium.webdriver.common.action_chains import ActionChains
|
262
|
+
|
263
|
+
from selenium.webdriver.chrome.options import Options
|
264
|
+
|
265
|
+
from time import sleep, time
|
266
|
+
|
267
|
+
import random
|
268
|
+
|
269
|
+
import requests
|
270
|
+
|
271
|
+
from bs4 import BeautifulSoup
|
272
|
+
|
273
|
+
import re
|
274
|
+
|
275
|
+
from fake_useragent import UserAgent
|
276
|
+
|
277
|
+
import openpyxl
|
278
|
+
|
279
|
+
import time
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
def ui(driver):
|
284
|
+
|
285
|
+
driver.get('https://note.com/norimac7/n/n55c154a58290')
|
286
|
+
|
287
|
+
print('ゴリラ')
|
288
|
+
|
289
|
+
print(driver.title)
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
if __name__ == '__main__':
|
294
|
+
|
295
|
+
# アクセスの定義づけ
|
296
|
+
|
297
|
+
options = Options()
|
298
|
+
|
299
|
+
user_agent = [
|
300
|
+
|
301
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.2 Safari/605.1.15',
|
302
|
+
|
303
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15',
|
304
|
+
|
305
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36']
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
UA = user_agent[random.randrange(0, len(user_agent), 1)]
|
310
|
+
|
311
|
+
options.add_argument('--user-agent=' + UA)
|
312
|
+
|
313
|
+
# options.add_argument('--headless')
|
314
|
+
|
315
|
+
driver = webdriver.Chrome(options=options)
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
ui(driver)
|
320
|
+
|
321
|
+
```
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
エラー内容
|
326
|
+
|
327
|
+
```ここに言語を入力
|
328
|
+
|
329
|
+
(base) namae@namae-Pro ~ % /Users/namae/Downloads/dir/build/test/test ; exit;
|
330
|
+
|
331
|
+
[16933] Error loading Python lib '/Users/namae/Downloads/dir/build/test/libpython3.8.dylib': dlopen: dlopen(/Users/namae/Downloads/dir/build/test/libpython3.8.dylib, 10): image not found
|
332
|
+
|
333
|
+
Saving session...
|
334
|
+
|
335
|
+
...copying shared history...
|
336
|
+
|
337
|
+
...saving history...truncating history files...
|
338
|
+
|
339
|
+
...completed.
|
340
|
+
|
341
|
+
```
|
238
342
|
|
239
343
|
|
240
344
|
|