ตอนนี้กำลังทำ selenium เพื่อ check error 404 ในหน้าเว็บที่ต้องการเข้าถึงอยู่ค่ะ ลองใช้โค้ด ตามที่ได้รับแนะนำมา
ตัวอย่างโค้ด
แต่ว่ามันขึ้น error แบบนี้
โค้ด: เลือกทั้งหมด
Traceback (most recent call last):
File "C:/Users/panchalee/PycharmProjects/Selenium/sel5.py", line 16, in <module>
browser.getPageSource().contains("404");
AttributeError: 'WebDriver' object has no attribute 'getPageSource'
อยากทราบว่าจะต้องแก้ไขอย่างไรคะ?
ตอนนี้กำลังทำ selenium เพื่อ check error 404 ในหน้าเว็บที่ต้องการเข้าถึงอยู่ค่ะ ลองใช้โค้ด ตามที่ได้รับแนะนำมา
ตัวอย่างโค้ด
[code]browser.getPageSource().contains("404");[/code]
แต่ว่ามันขึ้น error แบบนี้
[code]Traceback (most recent call last):
File "C:/Users/panchalee/PycharmProjects/Selenium/sel5.py", line 16, in <module>
browser.getPageSource().contains("404");
AttributeError: 'WebDriver' object has no attribute 'getPageSource'[/code]
อยากทราบว่าจะต้องแก้ไขอย่างไรคะ?