Skip to content

Commit

Permalink
handled two potential exception and piece1 to 4 returned and results …
Browse files Browse the repository at this point in the history
…store as pickle on disk, piece1-3.pkl #180
  • Loading branch information
YanLiang1102 committed Jul 2, 2017
1 parent 8ec8622 commit 3bb809b
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 11 deletions.
80 changes: 80 additions & 0 deletions otherHelperCode/english_to_arabic_dictionary/geckodriver.log
Original file line number Diff line number Diff line change
Expand Up @@ -573,3 +573,83 @@ Full stack:
1498940316672 Marionette INFO Listening on port 42451
1498940316803 Marionette WARN TLS certificate errors will be ignored for this session
1498940323342 Marionette WARN TLS certificate errors will be ignored for this session
*************************
A coding exception was thrown and uncaught in a Task.

Full message: TypeError: NetworkError when attempting to fetch resource.
Full stack:
*************************
*************************
A coding exception was thrown and uncaught in a Task.

Full message: TypeError: NetworkError when attempting to fetch resource.
Full stack:
*************************
*************************
A coding exception was thrown and uncaught in a Task.

Full message: TypeError: NetworkError when attempting to fetch resource.
Full stack:
*************************
*************************
A coding exception was thrown and uncaught in a Task.

Full message: TypeError: NetworkError when attempting to fetch resource.
Full stack:
*************************
1498942064152 geckodriver INFO Listening on 127.0.0.1:48399
1498942064152 geckodriver INFO Listening on 127.0.0.1:37277
1498942064156 geckodriver INFO Listening on 127.0.0.1:33965
1498942064157 geckodriver INFO Listening on 127.0.0.1:42099
1498942064350 geckodriver::marionette INFO Starting browser /usr/lib/firefox/firefox.sh with args ["-marionette"]
1498942064351 geckodriver::marionette INFO Starting browser /usr/lib/firefox/firefox.sh with args ["-marionette"]
1498942064368 geckodriver::marionette INFO Starting browser /usr/lib/firefox/firefox.sh with args ["-marionette"]
1498942064369 geckodriver::marionette INFO Starting browser /usr/lib/firefox/firefox.sh with args ["-marionette"]
1498942072974 Marionette INFO Listening on port 40801
1498942073243 Marionette INFO Listening on port 38609
1498942073477 Marionette INFO Listening on port 37651
1498942073970 Marionette WARN TLS certificate errors will be ignored for this session
1498942074097 Marionette INFO Listening on port 38273
1498942074284 Marionette WARN TLS certificate errors will be ignored for this session
1498942074478 Marionette WARN TLS certificate errors will be ignored for this session
1498942074876 Marionette WARN TLS certificate errors will be ignored for this session
*************************
A coding exception was thrown and uncaught in a Task.

Full message: TypeError: NetworkError when attempting to fetch resource.
Full stack:
*************************
*************************
A coding exception was thrown and uncaught in a Task.

Full message: TypeError: NetworkError when attempting to fetch resource.
Full stack:
*************************
*************************
A coding exception was thrown and uncaught in a Task.

Full message: TypeError: NetworkError when attempting to fetch resource.
Full stack:
*************************
*************************
A coding exception was thrown and uncaught in a Task.

Full message: TypeError: NetworkError when attempting to fetch resource.
Full stack:
*************************
Corrupt JPEG data: 179 extraneous bytes before marker 0xd9
Corrupt JPEG data: 179 extraneous bytes before marker 0xd9
JavaScript warning: https://a.slack-edge.com/bv1-1/slack_beacon.9555f5e382af865f618b.min.js, line 5163: unreachable code after return statement
JavaScript warning: https://a.slack-edge.com/bv1-1/slack_beacon.9555f5e382af865f618b.min.js line 1 > eval, line 5163: unreachable code after return statement
JavaScript warning: https://a.slack-edge.com/bv1-1/slack_beacon.9555f5e382af865f618b.min.js, line 5163: unreachable code after return statement
JavaScript warning: https://a.slack-edge.com/bv1-1/slack_beacon.9555f5e382af865f618b.min.js line 1 > eval, line 5163: unreachable code after return statement
JavaScript warning: https://a.slack-edge.com/bv1-1/rollup-brand.c4ec2770eb61bcaf9d83.min.js, line 5163: unreachable code after return statement
JavaScript warning: https://a.slack-edge.com/bv1-1/rollup-brand.c4ec2770eb61bcaf9d83.min.js line 1 > eval, line 5163: unreachable code after return statement
1498966155096 geckodriver INFO Listening on 127.0.0.1:42299
1498966155187 geckodriver::marionette INFO Starting browser /usr/lib/firefox/firefox.sh with args ["-marionette"]
1498966160218 Marionette INFO Listening on port 40447
1498966160399 Marionette WARN TLS certificate errors will be ignored for this session
1498966169182 Marionette INFO Ceased listening
1498966171101 Marionette INFO Ceased listening
1498966174287 Marionette INFO Ceased listening
1498966181329 Marionette INFO Ceased listening
Binary file not shown.
Binary file not shown.
Binary file not shown.
26 changes: 15 additions & 11 deletions otherHelperCode/english_to_arabic_dictionary/py_hack_wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ def formatOriginalNameToWikiName(originalname):

#inorder to be parallel we need to pass in a new driver
def MakeSeleniumToSearchWithOriginalName(originalname,driver):
wikiname=formatOriginalNameToWikiName(originalname)
wikiname=''
try:
wikiname=formatOriginalNameToWikiName(originalname)
except:
pass
nametosearch=originalname if(wikiname=="") else wikiname
driver.get("https://en.wikipedia.org/wiki/"+str(nametosearch))
result={}
result["findresult"]={}
result["nofind"]={}
try:
driver.get("https://en.wikipedia.org/wiki/"+str(nametosearch))
elem = driver.find_element_by_css_selector(".interwiki-ar a")
"""
these two lines of code needs to run before elem.click(), since it will goto
Expand Down Expand Up @@ -177,18 +181,18 @@ def func4():

#manager=Manager()
#d=manager.dict()
p1=Process(target=func1)
p1.start()
p2=Process(target=func2)
p2.start()
p3=Process(target=func3)
p3.start()
# p1=Process(target=func1)
# p1.start()
# p2=Process(target=func2)
# p2.start()
# p3=Process(target=func3)
# p3.start()
p4=Process(target=func4)
p4.start()
p1.join()
p2.join()
p3.join()
p4.join()
# p2.join()
# p3.join()
# p4.join()
print("--- %s seconds ---" % (time.time() - start_time))
#writeResultToDisk(d,"wholeresult.pkl")

0 comments on commit 3bb809b

Please sign in to comment.