我正在尝试编写一个脚本来检查网站.这是我第一次使用硒.我正在尝试在OSX系统上运行脚本.虽然我检查了/Library/Python/2.7/site-packages并且selenium-2.46.0-py2.7.egg存在,但是当我运行脚本时它一直告诉我没有要导入的selenium模块.
这是我运行代码时得到的日志:
Run Code Online (Sandbox Code Playgroud)Traceback (most recent call last): File "/Users/GiulioColleluori/Desktop/Class_Checker.py", line 10, in <module> from selenium import webdriver ImportError: No module named 'selenium'
如果你能告诉我你是否知道什么可能导致这个问题值得高度赞赏.
谢谢.
我用a UISearchController和a 做了一个视图控制器UITableView.您可以从搜索范围按钮中选择两种不同类型的搜索:组和人员.两种搜索都可以在桌面上显示并显示结果.但是,如果单击每个单元格,则应将它们定向到不同的动态页面(动态组页面或动态人员配置文件页面).用于组的工作,而用于配置文件的工作则不工作.这意味着每当我从我得到的结果中点击一个人单元格时,没有任何反应,我在控制台上打印出以下警告:
Warning: Attempt to present <MyProject.profileView: 0x13e9df000> on <MyProject.SearchPage: 0x142a1d8f0> which is already presenting <UISearchController: 0x142a1f7c0>
Run Code Online (Sandbox Code Playgroud)
如果您知道为什么会发生这种情况,如果您能告诉我,我们将非常感激.
编辑:这是应该将单元格链接到不同视图控制器的功能:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if self.searchForGroups {
let detailCell:PFObject = self.filteredGroups.objectAtIndex(indexPath.row) as! PFObject
let vc = self.storyboard!.instantiateViewControllerWithIdentifier("DynamicCellView") as! DynamicCellView
vc.GroupId = detailCell.objectId!
self.presentViewController(vc, animated: false, completion: nil)
}else{
//Link to use profile
let user = self.peopleResults[indexPath.row]
let vc = self.storyboard!.instantiateViewControllerWithIdentifier("ProfileView") as! profileView
vc.profileId = user.objectId!
self.presentViewController(vc, animated: true, completion: nil)
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个问题:我有一个UIView包含a UISearchBar作为标头UITableView。问题是,每当我点击时UISearchBar,动画的作用域按钮就会出来,从而隐藏了表格第一行的一部分。我看了很多类似的问题,但没有一个答案有效。有没有一种方法可以向底部添加约束,headerView以便UITableView每当UISearchBar焦点对准并被编辑时,范围按钮视图的高度就会下降?
这是我在其中添加代码的代码UISearchController:
searchController.searchResultsUpdater = self
searchController.dimsBackgroundDuringPresentation = false
definesPresentationContext = true
searchController.searchBar.scopeButtonTitles = ["Groups", "People"]
tableView.tableHeaderView = searchController.searchBar
searchController.searchBar.delegate = self
searchController.searchBar.sizeToFit()
searchController.searchBar.barTintColor = darkGreen
searchController.searchBar.tintColor = yellow
searchController.searchBar.backgroundColor = darkGreen
tableView.sectionHeaderHeight = UITableViewAutomaticDimension
Run Code Online (Sandbox Code Playgroud)
如果可以的话,请让我知道如何解决此错误,我将不胜感激!
谢谢!